当前位置:网站首页>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边栏推荐
- About whether arm's large and small end mode is related to CPU or compiler
- Bigdecimalavoiddoubleconstructorrule: do not directly use the double variable as a parameter to construct BigDecimal
- [golang] leetcode intermediate - jumping game & different paths
- How MySQL works - Chapter 14
- Implementation of pure three-layer container network based on BGP
- Does the wave of layoffs in Chinese enterprises in 2021 need to be "judged" by morality?
- Window object
- Several key points for enterprises to pay attention to digital transformation
- Leetcode daily question solution: 717 1-bit and 2-bit characters - reverse order
- Monotone stack template
猜你喜欢

Wechat applet development - Implementation of rotation chart

Considerations for it project demand analysis

SAP license: ERP for supply chain management and Implementation

Graph traversal (BFS and DFS) C language pure handwriting

Nine practical guidelines for improving responsive design testing
[quick news] the jeecgboot low code platform was successfully selected into the 2021 scientific innovation China · open source innovation list

High quality defect analysis: let yourself write fewer bugs

It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements

JS position operation

BOM(Browser Object Model)
随机推荐
JS clothing photo album case
Gateway solves cross domain access
Wechat applet development - Implementation of rotation chart
Differences between get and post request modes
Palindrome string (two methods)
Nine practical guidelines for improving responsive design testing
Selection (030) - what is the output of the following code?
Leetcode question 136 [single number]
How can an enterprise successfully complete cloud migration?
What are the grades of financial products?
Window object
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
Business based precipitation component = & gt; manage-table
Ultimate Guide: comprehensive analysis of log analysis architecture of Enterprise Cloud native PAAS platform
Analysis on the issue of raising the right of MSSQL in 2021 secondary vocational group network security competition in Shandong Province
Business leaders compete for CIO roles
ASP. Net hosting uploading file message 500 error in IIS
如何在 R 中执行幂回归
Recommend a distributed JVM monitoring tool, which is very practical!
Creating a new MySQL user in Amazon RDS environment - creating a new MySQL user in Amazon RDS environment