-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add information about the different degrees of freedom default to the srvyr
vs survey
vignette
#119
Comments
Not a bug (though a little confusing, I admit). srvyr tries to be helpful by setting the If you prefer the results you got using the survey package, you can do this in srvyr: (srvyr_ci_2 <-
srs_design_srvyr %>%
summarise(enroll = survey_mean(enroll, vartype = "ci", df = Inf)))
#> enroll enroll_low enroll_upp
#> 1 584.61 530.969 638.251 Or to get the srvyr results in survey: api_mean_2 <- svymean(~enroll, srs_design)
(svy_ci_2 <- confint(api_mean_2, df = degf(srs_design)))
#> 2.5 % 97.5 %
#> enroll 530.6408 638.5792 |
Thank you for explaining @gergness. And indeed the I think it would be good to have this aspect added in the > svy_ci_2[1,1] == srvyr_ci$enroll_low
[1] TRUE
> svy_ci_2[1,2] == srvyr_ci$enroll_upp
[1] TRUE
>
> srvyr_ci$enroll_low == coef(api_mean) - qt(0.975, df = degf(srs_design)) * SE(api_mean)
enroll
enroll TRUE
> srvyr_ci$enroll_upp == coef(api_mean) + qt(0.975, df = degf(srs_design)) * SE(api_mean)
enroll
enroll TRUE
>
> qt(0.975, df=Inf) == qnorm(0.975)
[1] TRUE |
srvyr
vs survey
vignette
srvyr
vs survey
vignettesrvyr
vs survey
vignette
yeah, makes sense |
It appears that the 95% confidence limits from
survey_mean()
are slightly different from those obtained withsurvey::svymean()
- is this a bug?Created on 2021-05-07 by the reprex package (v2.0.0)
Session info
The text was updated successfully, but these errors were encountered: