当前位置:网站首页>如何在 R 中创建线性模型预测区间 并可视化
如何在 R 中创建线性模型预测区间 并可视化
2022-06-24 18:32:00 【Mrrunsen】
线性回归模型可 用于两件事:
(1)量化一个或多个预测变量与响应变量之间的关系。
(2) 使用模型预测未来值。
关于 (2),当我们使用回归模型来预测未来值时,我们通常对预测 精确值 以及 包含一系列可能值的区间 感兴趣。这个区间称为 预测区间。
例如,假设我们使用 学习时间 作为预测变量, 考试成绩 作为响应变量来拟合一个简单的线性回归模型。使用这个模型,我们可以预测一个学习 6 小时的学生将获得91的考试成绩。
但是,由于此预测存在不确定性,我们可能会创建一个预测区间,表示学习 6 小时的学生有 95% 的机会获得85到97之间的考试成绩。这个值范围被称为 95% 的预测区间,它对我们来说通常比仅仅知道准确的预测值更有用。
如何在 R 中创建预测区间
为了说明如何在 R 中创建预测区间,我们将使用内置的 mtcars 数据集,其中包含有关几种不同汽车特征的信息:
首先,我们将拟合一个简单的线性回归模型,使用 disp 作为预测变量, mpg 作为响应变量。
#fit simple linear regression model
model <- lm
边栏推荐
- ASP. Net hosting uploading file message 500 error in IIS
- EasyCVR国标协议接入的通道,在线通道部分播放异常是什么原因?
- Selection (030) - what is the output of the following code?
- Design topic: MATLAB UAV flight operation
- Introduction to yottastore, a new generation of storage engine for VPC TCE cos
- Noi Mathematics: solution of quadratic congruence equation
- Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot
- Overall planning and construction method of digital transformation
- Specification for self test requirements of program developers
- Redis learning -- list of redis operations
猜你喜欢
13 skills necessary for a competent QA Manager
NVM download, installation and use
ASP. Net hosting uploading file message 500 error in IIS
Nine practical guidelines for improving responsive design testing
He "painted" what a smart city should look like with his oars
Considerations for it project demand analysis
What if the database table structure changes? Smartbi products support one click synchronization
Get max value of a bit column - get max value of a bit column
R language Quantitative Ecology redundancy analysis RDA analysis plant diversity species data visualization
How to decompile APK files
随机推荐
专有云TCE COS新一代存储引擎YottaStore介绍
Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot
Selection (030) - what is the output of the following code?
Data modeling technology of Business Intelligence BI
Network security database penetration of secondary vocational group in 2022
Restcloud ETL extracting dynamic library table data
Error reported after NPM I
EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化
Issue 39: MySQL time class partition write SQL considerations
Three layer switching experiment
Design topic: MATLAB cellular automata personnel evacuation
Analysis on the issue of raising the right of MSSQL in 2021 secondary vocational group network security competition in Shandong Province
Sword finger offer 10- ii Frog jumping on steps
Optimizing bloom filter: challenges, solutions, and comparisons
-Bash: wget: command not found
Application service access configuration parameters
Business based precipitation component = & gt; manage-table
Flutter dart regular regexp special characters $, () (IV)
Data driven decision making: Decision intelligence and design thinking
电子元器件行业B2B电商市场模式、交易能力数字化趋势分析