5 Constant Model

## 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.

5.1. Fit the constant model g0: childHeight ~ 1.

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.

5.2. Obtain the coefficients, standard error of estimate, t-value of estimate, and p-value of estimate for model g0.

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.

5.3. Interpret the value of the coefficient.

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.