简体   繁体   English

具有无限斜率的线性回归

[英]Linear regression with infinite slope

I know how to perform simple linear regression in R but how to perform the regression with infinite slope (see an example with same dataset from excel) with R1 on x-axis and LAI1 on the y-axis.我知道如何在 R 中执行简单的线性回归,但如何使用 x 轴上的 R1 和 y 轴上的 LAI1 执行具有无限斜率的回归(参见 excel 中相同数据集的示例)。

   R1 LAI1 
233.7 1.34 
411.3 4.42 
143.4 3.57 
136.7 3.27 
249.0 5.53 
 59.0 1.79 
186.0 4.32 
185.0 2.58 

在此处输入图像描述

What do you mean with "infinite slope"? “无限坡度”是什么意思? This is how you would do it in R:这就是你在 R 中的做法:

library(dplyr)
df <- tibble::tribble(
    ~R1, ~LAI1,
  233.7,  1.34,
  411.3,  4.42,
  143.4,  3.57,
  136.7,  3.27,
    249,  5.53,
     59,  1.79,
    186,  4.32,
    185,  2.58
  )


model1 <- lm(LAI1 ~ R1, data = df)
summary(model1)

plot(df$R1, df$LAI1)
abline(model1)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM