当前位置:网站首页>How to create a linear model prediction interval in R and visualize it
How to create a linear model prediction interval in R and visualize it
2022-06-24 18:38:00 【Mrrunsen】
Linear regression model can For two things :
(1) Quantify the relationship between one or more predictors and response variables .
(2) Use models to predict future values .
About (2), When we use regression models to predict future values , We usually predict The exact value as well as An interval containing a series of possible values Interested in . This interval is called Prediction interval .
for example , Suppose we use Learning time As a predictive variable , Test results As a response variable to fit a simple linear regression model . Using this model , We can predict a learning 6 Hours of students will receive 91 The test results of .
however , Due to the uncertainty of this forecast , We might create a prediction interval , It means learning 6 Hours of students have 95% The opportunity to get 85 To 97 Between the exam results . This range of values is called 95% The prediction interval , It is usually better for us than It's more useful just to know the exact predicted value .
How to be in R Create forecast interval in
To show how R Create forecast interval in , We're going to use the built-in mtcars Data sets , It contains information about several different car features :
First , We will fit a simple linear regression model , Use disp As a predictive variable , mpg As a response variable .
#fit simple linear regression model
model <- lm
边栏推荐
- Seven strategies for successfully integrating digital transformation
- SDL: cannot play audio after upgrading openaudio to openaudiodevice
- Complete Guide to web application penetration testing
- How does the video platform import the old database into the new database?
- Flutter dart regular regexp special characters $, () (IV)
- Three years of bug free, tips for improving code quality
- Creating a new MySQL user in Amazon RDS environment - creating a new MySQL user in Amazon RDS environment
- Get max value of a bit column - get max value of a bit column
- Easynvr fails to use onvif to detect the device. What is the reason why "no data" is displayed?
- R中的指数回归
猜你喜欢
How to select the best test cases for automation?
Nacos cluster starts throwing set of SQL_ SELECT_ LIMIT is not support
Complete Guide to web application penetration testing
国家出手了!对知网启动网络安全审查
Two micro service interviews where small companies suffer losses
Skills of writing test cases efficiently
JS event details
JS string method
360 digital released information security trends in January: 120000 fraud risks were captured and users were reminded 2.68 million times
JS local storage
随机推荐
How can programmers reduce bugs in development?
On software requirement analysis
Overall planning and construction method of digital transformation
Project Management Guide: tips, strategies and specific practices
Flutter dart regular regexp special characters $, () (IV)
What is business intelligence (BI)?
Architecture decryption from distributed to microservice: several common microservice architecture schemes
Four security issues of low code and no code development
Common MySQL commands of installation free version
An analysis of the comments on the TV series Douban by procedural apes
Nacos cluster starts throwing set of SQL_ SELECT_ LIMIT is not support
Five advantages and disadvantages of Bi
Complete Guide to web application penetration testing
Analysis on the issue of raising the right of MSSQL in 2021 secondary vocational group network security competition in Shandong Province
Leetcode skimming questions - the 72nd biweekly match and 281 weekly match
About whether arm's large and small end mode is related to CPU or compiler
Application service access configuration parameters
Rapidssl getting started SSL certificate
Mariana Trench, Facebook's open source code analysis tool
JS picture switching case