当前位置:网站首页>如何在 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边栏推荐
- 【leetcode】838. Push domino (Analog)
- How about China Power Investment Xianrong futures? Is it safe to open futures accounts?
- How to create simple shapes in illustrator 2022
- [NLP] 3 papers on how Stanford team builds a better chat AI
- Flutter dart regular regexp matches non printing characters \cl\cj\cm\ck
- How to decompile APK files
- It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements
- Easygbs video platform TCP active mode streaming exception repair
- Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
- 腾讯云TCS:面向应用的一站式PaaS 平台
猜你喜欢

Flutter dart regular regexp special characters $, () (IV)

Regression testing strategy for comprehensive quality assurance system

Several key points for enterprises to pay attention to digital transformation
Ultimate Guide: comprehensive analysis of log analysis architecture of Enterprise Cloud native PAAS platform

Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
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

ASP. Net hosting uploading file message 500 error in IIS

2022 network security C module of the secondary vocational group scans the script of the surviving target aircraft (municipal, provincial and national)

NVM download, installation and use
R language Quantitative Ecology redundancy analysis RDA analysis plant diversity species data visualization
随机推荐
NVM download, installation and use
Optimizing bloom filter: challenges, solutions, and comparisons
On software requirement analysis
From file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG key to retrieve the key source "MySQL 5.7 community server" is installed, but not applicable to
What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?
Ten excellent business process automation tools for small businesses
How does the chief information security officer discuss network security with the enterprise board of directors
How to create simple shapes in illustrator 2022
你知道CMDB吗?
Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
Php7.4.28 installing the pcntl extension
Tencent cloud TCS: an application-oriented one-stop PAAS platform
SQL basic tutorial (learning notes)
Does the wave of layoffs in Chinese enterprises in 2021 need to be "judged" by morality?
Can the money invested in financial products be withdrawn at any time?
Leetcode question 136 [single number]
Easygbs video platform TCP active mode streaming exception repair
Leetcode daily question solution: 717 1-bit and 2-bit characters - reverse order
Selection (031) -cool_ How long can secret be accessed?
Exception: Gradle task assembleDebug failed with exit code 1