Multiple Linear Regression: Answers
Calculate the sample size for the following scenarios (with α=0.05, and power=0.80):
1. You are interested in determining if height (meters), weight (grams), and fertilizer added (grams) in
plants can predict yield (grams of berries). You collect the following trial data.
• Created variables in R
• yield<-c(46.8, 48.7, 48.4, 53.7, 56.7)
• height<-c(14.6, 19.6, 18.6, 25.5, 20.4)
• weight<-c(95.3, 99.5, 94.1, 110, 103)
• Fert<-c(2.1, 3.2, 4.3, 1.1, 4.3)
• Ran linear model to find R-squared
• linearMod2 <-lm(height~yield + weight + Fert)
• summary(linearMod2) -> Adj R
2
= 0.6765
• f2=R=√(adj R
2
)= = √(0.6765)=0.822
• pwr.f2.test(u=3, f2=0.822, sig.level=0.05, power=0.80)
• v=13.7 -> 14+ 4(variables) ->18 samples
2. You are interested in determining if the size of a city (in square miles), number of houses, number of
apartments, and number of jobs can predict the population of the city (in # of individuals).
• Guessed a large effect size (0.35); for 4 variables (df=3)
• pwr.f2.test(u=3, f2=0.35, sig.level=0.05, power=0.80)
• v=31.31 -> 32+ 4(variables) ->36 samples
Yield 46.8 48.7 48.4 53.7 56.7
Height 14.6 19.6 18.6 25.5 20.4
Weight 95.3 99.5 94.1 110 103
Fertilizer 2.1 3.2 4.3 1.1 4.3