Analyzing Survey Data in R
Kelly McConville
Assistant Professor of Statistics
Null Hypothesis: The monthly average number of poor health days is the same for smokers and non-smokers.
Alternative Hypothesis: The monthly average number of poor health days is different for smokers and non-smokers.
Test statistic:
$$ t = \frac{\bar{y}_s - \bar{y}_n}{SE} $$
svyttest(formula = DaysPhysHlthBad ~ SmokeNow,
design = NHANES_design)
Design-based t-test
data: DaysPhysHlthBad ~ SmokeNow
t = 3.8208, df = 32, p-value = 0.0005778
alternative hypothesis: true difference in mean is not equal to 0
sample estimates:
difference in mean
1.042766
Analyzing Survey Data in R