R로 하는 설문 데이터 분석
Kelly McConville
Assistant Professor of Statistics


$$\hat{y} = a + b x$$
$$\sum_{i=1}^n w_i (y_i -\hat{y}_i)^2$$
mod <- svyglm(HeadCirc ~ AgeMonths, design = NHANES_design)
summary(mod)
svyglm(formula = HeadCirc ~ AgeMonths, design = NHANES_design)
Survey design:
svydesign(data = NHANESraw, strata = ~SDMVSTRA, id = ~SDMVPSU,
nest = TRUE, weights = ~WTMEC4YR)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 38.1376 0.2004 190.3 <2e-16 ***
AgeMonths 1.0708 0.0593 18.1 <2e-16 ***
(Some output omitted)
$$\hat{y} = a + b x$$
$$E(y) = A + B x$$
귀무 가설: 머리 둘레와 나이는 선형 관계가 없다 (즉, $B = 0$).
대립 가설: 머리 둘레와 나이는 선형 관계가 있다 (즉, $B \neq 0$).
mod <- svyglm(HeadCirc ~ AgeMonths, design = NHANES_design)
summary(mod)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 38.1376 0.2004 190.3 <2e-16 ***
AgeMonths 1.0708 0.0593 18.1 <2e-16 ***
(Some Output Omitted)
검정 통계량: $t = \frac{b}{SE}$
R로 하는 설문 데이터 분석