回帰分析(データからの知識発見)

放送大学「データからの知識発見」第6章 回帰分析

標準化していない身長と体重のデータ(テキストとは異なるデータ)

1
2
3
4
5
6
7
height<-c(147.3,149.9,152.4,154.9,157.5,160,162.6,165.1,167.6,170.2,172.7,175.3,177.8,180.3,182.9)
weight<-c(52.3,53.2,54.5,55.9,57.3,58.6,60,61.4,63.2,64.5,66.4,68.2,70,72.3,74.5)
w1<-data.frame(height,weight)
row.names(w1)<-c("A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","A13","A14","A15")
w2<-lm(weight~height,data=w1)
library(stargazer)
stargazer(w2,type="html",single.row=T)











Dependent variable:
weight
height0.617 (0.016)
Constant-39.755 (2.692)
Observations15
R20.991
Adjusted R20.990
Residual Std. Error0.692 (df = 13)
F Statistic1,439.108 (df = 1; 13)
Note:p<0.1; p<0.05; *p<0.01< td="">
1
2
plot(w1,main="回帰直線")
abline(w2,col="red")