library("MASS")
plot(survey$Height, survey$Wr.Hnd, xlab="Writing handspan (cm)", ylab="Height (cm) ")
You will see the following result:
cor(survey$Height, survey$Wr.Hnd, use="complete.obs")
估计得到学生的手夸度和身高相关系数是 0.6009909。
survfit=lm(Height~Wr.Hnd, data=survey)
> survfit
Call:
lm(formula = Height ~ Wr.Hnd, data = survey)
Coefficients:
(Intercept) Wr.Hnd
113.954 3.117