Final answer:
To obtain the median high school graduation rates for groups of states defined by combinations of the factors state.region and state.size using the state.x77 data matrix and the tapply() function, you can use the provided R code. It first creates the state.size factor and then applies the tapply() function to calculate the median high school graduation rates for each combination of state.region and state.size.
Step-by-step explanation:
To obtain the median high school graduation rates for groups of states defined by combinations of the factors state.region and state.size using the state.x77 data matrix and the tapply() function, you can use the following R code:
state.size <- cut(state.x77[, "Population"], breaks=c(0, 2000, 10000, Inf), labels=c("Small", "Medium", "Large"))
tapply(state.x77[, "HS Grad"], list(state.region, state.size), median)
This code first creates the state.size factor using the cut() function and then applies the tapply() function to calculate the median high school graduation rates for each combination of state.region and state.size.