We will use the dataset from https://drive.google.com/file/d/0BxQfpNgXuWoIWkl4M3dMZDFtUkU/view
Step 1
we call the dataset lungcap.csv
Step2
>>> file<-read.delim("C:/Users/Owner/Downloads/lungcap.csv", header=TRUE, sep = ',')
>>> attach(file) # this appends the header variables like Age, Gender, ....
Step3
The model is below
>>> model1 <- lm(LungCap ~ Age + Height)
>>> summary(model1)
Step4
We produce the confidence intervals with
>>> confint(model1, conf.level = 0.95)
Step 5
We just plot the linear regression for each variable
>plot(Height, LungCap)
No comments:
Post a Comment