## install.packages("HistData", repos = "http://cran.us.r-project.org", dependencies=TRUE). (After the first compile, we may comment out this line.
library("HistData")
data(GaltonFamilies)
Galton2 <- data.frame(GaltonFamilies)
names(Galton2)
## [1] "family" "father" "mother" "midparentHeight"
## [5] "children" "childNum" "gender" "childHeight"
Note: I will use “we” or “us” hereinafter to avoid first paragraph narrative which in my opinion does not come across as a very convincing means of communicating data analysis. In other words, the use of “we” or “us” does not indicate that another individual or entity assisted in the response to the six Mid-Term Exam responses.
g0 <- lm(childHeight~1, Galton2)
Response to Question No. 5.1: As shown above, we use the R function lm to create interaction model “g0” which is used to carry out regression at a single stratum (i.e., “childHeight”) analysis of variance and analysis of co-variance.
summary(g0)$coef
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 66.74593 0.1171167 569.9097 0
Response to Question No. 5.2: As shown above, the variables are displayed.
mean(Galton2$childHeight)
## [1] 66.74593
## [1] 66.75
## [1] "The coefficient is the mean of childHeight, 67 inches."
Response to Question No. 5.3: As shown in the output data above, the value of the coefficient is 66.75 as such with respect to the varable of interest here childHeight, the mean is 67 inches.