Example: quiz answers

survey: Analysis of Complex Survey Samples

Package Survey '. April 27, 2019. Title Analysis of Complex Survey Samples Description Summary statistics, two-sample tests, rank tests, generalised linear models, cumula- tive link models, Cox models, loglinear models, and general maximum pseudolikelihood estima- tion for multistage stratified, cluster-sampled, unequally weighted Survey Samples . Vari- ances by Taylor series linearisation or replicate weights. Post-stratification, calibration, and rak- ing. Two-phase subsampling designs. Graphics. PPS sampling without replacement. Princi- pal components, factor Analysis . Version Author Thomas Lumley Maintainer ``Thomas Lumley'' License GPL-2 | GPL-3. Depends R (>= ), grid, methods, Matrix, survival Imports stats, graphics, splines, lattice, minqa, numDeriv, mitools (>= ). Suggests foreign, MASS, KernSmooth, hexbin, RSQLite, RODBC, quantreg, parallel, CompQuadForm, DBI.

modification of this, bootstrap is Canty and Davison’s bootstrap, subbootstrap is Rao and Wu’s (n 1) bootstrap, and mrbbootstrap is Preston’s multistage rescaled bootstrap. With a svyimputationList object, the same replicate weights will be used for each imputation if the sampling weights are all the same and separate.replicates=FALSE. Usage

Tags:

  Survey, Bootstrap

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of survey: Analysis of Complex Survey Samples

1 Package Survey '. April 27, 2019. Title Analysis of Complex Survey Samples Description Summary statistics, two-sample tests, rank tests, generalised linear models, cumula- tive link models, Cox models, loglinear models, and general maximum pseudolikelihood estima- tion for multistage stratified, cluster-sampled, unequally weighted Survey Samples . Vari- ances by Taylor series linearisation or replicate weights. Post-stratification, calibration, and rak- ing. Two-phase subsampling designs. Graphics. PPS sampling without replacement. Princi- pal components, factor Analysis . Version Author Thomas Lumley Maintainer ``Thomas Lumley'' License GPL-2 | GPL-3. Depends R (>= ), grid, methods, Matrix, survival Imports stats, graphics, splines, lattice, minqa, numDeriv, mitools (>= ). Suggests foreign, MASS, KernSmooth, hexbin, RSQLite, RODBC, quantreg, parallel, CompQuadForm, DBI.

2 URL NeedsCompilation no Repository CRAN. Date/Publication 2019-04-27 05:00:04 UTC. R topics documented: .. 3. api .. 5.. 8.. 9.. 11.. 12. bootweights .. 13. brrweights .. 14. 1. 2 R topics documented: calibrate .. 17. compressWeights .. 23.. 24. crowd .. 25.. 26. election .. 27. estweights .. 28. fpc .. 30.. 31. hadamard .. 32. hospital .. 34. HR .. 35.. 35. marginpred .. 37. mu284 .. 38. nhanes .. 39. nonresponse .. 40.. 41. paley .. 42. pchisqsum .. 44. postStratify .. 46. psrsq .. 48. rake .. 49. regTermTest .. 51. scd .. 53. SE .. 54. stratsample .. 55.. 55. surveyoptions .. 56. surveysummary .. 57. svrepdesign .. 61. svrVar .. 64.. 65. svyby .. 66. svycdf .. 69. svyciprop .. 70. svycontrast .. 72. svycoplot .. 73. svycoxph .. 74. svyCprod .. 76. svycralpha .. 78. svydesign .. 79. svyfactanal .. 82. svyglm .. 84. svyhist .. 87.

3 Svykappa .. 88. svykm .. 89. svyloglin .. 91. 3. svylogrank .. 93. svymle .. 94. svyolr .. 97. svyplot .. 99. svyprcomp .. 101. svypredmeans .. 102. svyquantile .. 103. svyranktest .. 106. svyratio .. 108. svyrecvar .. 110. svysmooth .. 112. svystandardize .. 114. svysurvreg .. 116. svytable .. 117. svyttest .. 120. trimWeights .. 121. twophase .. 122.. 125.. 126.. 127.. 128. withReplicates .. 129. yrbs .. 131. Index 133. Model comparison for glms. Description A method for the anova function, for use on svyglm objects. With a single model argument it produces a sequential anova table, with two arguments it compares the two models. Usage ## S3 method for class 'svyglm'. anova(object, object2 = NULL, test = c("F", "Chisq"), method = c("LRT", "Wald"), tolerance = 1e-05, .., force = FALSE). ## S3 method for class 'svyglm'. AIC(object.)

4 ,k=2). ## S3 method for class 'svyglm'. BIC(object,..,maximal). 4 Arguments object A svyglm object. object2 Optionally, another svyglm object. test Use (linear combination of) F or chi-squared distributions for p-values. F is usually preferable. method Use weighted deviance difference (LRT) or Wald tests to compare models tolerance For models that are not symbolically nested, the tolerance for deciding that a term is common to the models.. For AIC and BIC, optionally more svyglm objects force Force the tests to be done by explicit projection even if the models are symboli- cally nested (eg, for debugging). maximal A svyglm model that object (and .. if supplied) are nested in. k Multiplier for effective df in AIC. Usually 2. There is no choice of k that will give BIC. Details The reference distribution for the LRT depends on the misspecification effects for the parameters be- ing tested (Rao and Scott, 1984).

5 If the models are symbolically nested, so that the relevant parame- ters can be identified just by manipulating the model formulas, anova is equivalent to regTermTest. If the models are nested but not symbolically nested, more computation using the design matrices is needed to determine the projection matrix on to the parameters being tested. Typical examples of models that are nested but not symbolically nested are linear and spline models for a continuous covariate or linear and saturated models for a factor. The saddlepoint approximation is used for the LRT with numerator df greater than 1. AIC is defined using the Rao-Scott approximation to the weighted loglikelihood (Lumley and Scott, 2015). It replaces the usual penalty term p, which is the null expectation of the log likelihood ratio, by the trace of the generalised design effect matrix, which is the expectation under Complex sampling.

6 For computational reasons everything is scaled so the weights sum to the sample size. BIC is a BIC for the (approximate) multivariate Gaussian models on regression coefficients from the maximal model implied by each submodel (ie, the models that say some coefficients in the maximal model are zero) (Lumley and Scott, 2015). It corresponds to comparing the models with a Wald test and replacing the sample size in the penalty by an effective sample size. For computational reasons, the models must not only be nested, the names of the coefficients must match. Value Object of class if one model is given, otherwise of class regTermTest or regTermTestLRT. Note At the moment, AIC works only for models including an intercept. api 5. References Rao, JNK, Scott, AJ (1984) "On Chi-squared Tests For Multiway Contingency Tables with Propor- tions Estimated From Survey Data" Annals of Statistics 12:46-60.

7 Lumley, T., & Scott, A. (2014). "Tests for Regression Models Fitted to Survey Data". Australian and New Zealand Journal of Statistics, 56 (1), 1-14. Lumley T, Scott AJ (2015) "AIC and BIC for modelling with Complex Survey data" J Surv Stat Methodol 3 (1): 1-18. See Also regTermTest, pchisqsum Examples data(api). dclus2<-svydesign(id=~dnum+snum, weights=~pw, data=apiclus2). model0<-svyglm(I( "Yes")~ell+meals+mobility, design=dclus2, family=quasibinomial()). model1<-svyglm(I( "Yes")~ell+meals+mobility+ (stype), design=dclus2, family=quasibinomial()). model2<-svyglm(I( "Yes")~ell+meals+mobility+stype, design=dclus2, family=quasibinomial()). anova(model2). anova(model0,model2). anova(model1, model2). anova(model1, model2, method="Wald"). AIC(model0,model1, model2). BIC(model0, model2,maximal=model2). api Student performance in California schools Description The Academic Performance Index is computed for all California schools based on standardised testing of students.

8 The data sets contain information for all schools with at least 100 students and for various probability Samples of the data. Usage data(api). 6 api Format The full population data in apipop are a data frame with 6194 observations on the following 37. variables. cds Unique identifier stype Elementary/Middle/High School name School name (15 characters). sname School name (40 characters). snum School number dname District name dnum District number cname County name cnum County number flag reason for missing data pcttest percentage of students tested api00 API in 2000. api99 API in 1999. target target for change in API. growth Change in API. Met school-wide growth target? Met Comparable Improvement target both Met both targets awards Eligible for awards program meals Percentage of students eligible for subsidized meals ell English Language Learners' (percent).

9 Year-round school mobility percentage of students for whom this is the first year at the school average class size years K-3. average class size years 4-6. Number of core academic courses percent where parental education level is known percent parents not high-school graduates hsg percent parents who are high-school graduates percent parents with some college percent parents with college degree percent parents with postgraduate education average parental education level full percent fully qualified teachers api 7. emer percent teachers with emergency qualifications enroll number of students enrolled number of students tested. The other data sets contain additional variables pw for sampling weights and fpc to compute finite population corrections to variance. Details apipop is the entire population, apisrs is a simple random sample, apiclus1 is a cluster sample of school districts, apistrat is a sample stratified by stype, and apiclus2 is a two-stage cluster sample of schools within districts.

10 The sampling weights in apiclus1 are incorrect (the weight should be 757/15) but are as obtained from UCLA. Source Data were obtained from the Survey sampling help pages of UCLA Academic Technology Services;. these pages are no longer on line. References The API program has been discontinued at the end of 2018. Information is archived at https: Examples library( Survey ). data(api). mean(apipop$api00). sum(apipop$enroll, ). #stratified sample dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc). summary(dstrat). svymean(~api00, dstrat). svytotal(~enroll, dstrat, ). # one-stage cluster sample dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc). summary(dclus1). svymean(~api00, dclus1). svytotal(~enroll, dclus1, ). # two-stage cluster sample dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2).


Related search queries