Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

I know how to implement the simple linear regression in R but how to perform the regression with the infinite slope with R1 on the x-axis and LAI1 on the y-axis.

   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 

1 Answer

0 votes
by (107k points)

This is how you can do it in R programming:

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)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...