1
$\begingroup$

I am trying to conduct an analysis of complex survey data from The Survey of Health, Ageing and Retirement in Europe (SHARE) using either the R "survey" package or SPSS Complex Samples. The issue I am having is that the sampling design varied by country/subsample. Every main participant will have data for a sampling weight and at least one of the following: subsample, stratum1 or psu (depending on the sampling design applied in their area).

When I try to specify the survey design in R "survey" I get an error messages due to the presence of missing values (different survey designs). I was using the following code: svydesign(ids= ~psu+ssu, strata = ~stratum1+stratum2, data = SHARE, weights = ~cciw). Have I done something wrong here?

If I use SPSS Complex Samples and specify the design as sampling with replacement (1-stage) with 2 clusters (psu, ssu) and 2 strata (stratum1, stratum2) the analysis will run despite the missing values. Not sure what the difference is here, or if this is appropriate.

Would it be a better approach to only adjust for the sampling weights? For example: svydesign(id = ~mergeid, data = SHARE, weights = ~cciw).

The SHARE includes the following cross-sectional sample design variables

  • mergeid: Unique identifier for each participant
  • dw: Design weight
  • cchw: Calibrated cross-sectional household-level weight [calibrated using Deville and Särndal (1992) approach]
  • cciw: Calibrated cross-sectional individual-level weight [calibrated using Deville and Särndal (1992) approach]
  • subsample: Indicator for country-specific subsample [E.g., different age groups when some form of oversampling has been applied]
  • stratum1: Indicator for primary stratum
  • stratum2: Indicator for secondary stratum
  • psu: Primary sampling unit
  • ssu: Secondary sampling unit
$\endgroup$
0

1 Answer 1

0
$\begingroup$

here's how i might stack two distinct survey designs?

options( survey.lonely.psu = 'adjust' )

library(survey)

# if you have these two small datasets
df1 <- data.frame( onepsu = c( 1 , 1 , 2 , 2 ) , onestrata = c( 'a' , 'b' , 'c' , 'd' ) , myweights = 1:4 , somedata = c( 0 , 1 , 0 , 1 ) )
df2 <- data.frame( twopsu = c( 'w' , 'x' , 'y' , 'z' ) , twostrata = c( 1 , 2 , 1 , 2 ) , myweights = 4:1 , somedata = c( 1 , 1 , 0 , 0 ) )

# with these two distinct survey designs (both linearized, so `svydesign()` not `svrepdesign()`)
design1 <- svydesign( ~ onepsu , strata = ~ onestrata , data = df1 , weights = ~ myweights , nest = TRUE )
design2 <- svydesign( ~ twopsu , strata = ~ twostrata , data = df2 , weights = ~ myweights , nest = TRUE )

# add unique prefixes to the psu & strata variables
# and also add a dataset name to distinguish them
stackable_df1 <- transform( df1 , combinedpsu = paste0( 'first' , onepsu ) , combinedstrata = paste0( 'first' , onestrata ) , dataset = 'df1' )
stackable_df2 <- transform( df2 , combinedpsu = paste0( 'second' , twopsu ) , combinedstrata = paste0( 'second' , twostrata ) , dataset = 'df2' )

# remove non-matching variables
stackable_df1[ c( 'onepsu' , 'onestrata' ) ] <- NULL
stackable_df2[ c( 'twopsu' , 'twostrata' ) ] <- NULL

# stack the two datasets
combined_df <- rbind( stackable_df1 , stackable_df2 )

combined_design <- svydesign( ~ combinedpsu , strata = ~ combinedstrata , data = combined_df , weights = ~ myweights , nest = TRUE )

# separate dataset SEs match combined
svymean( ~ somedata , design1 )
svymean( ~ somedata , design2 )
svyby( ~ somedata , ~ dataset , combined_design , svymean )

# total across both designs also works
svymean( ~ somedata , combined_design )
$\endgroup$
2
  • $\begingroup$ It may be even more complex than that. I think some countries may have had register-based samples (so they have strata and people sampled directly from strata; PSU = person), some may have random digit dialing (very different conceptually but presenting itself as a stratified single stage design, too; PSU = person), and some may be geographically clustered (so they would have an actual PSU and then people as SSUs.) Counties obviously need to be (super)strata. I suspect survey would choke on a design where you have 1 stage in some strata and 2 stages in others. $\endgroup$
    – StasK
    Commented Aug 1, 2022 at 16:28
  • 1
    $\begingroup$ You could set stage 2 strata equal to PSUs if you needed to: stage 2 sampling is always stratified by stage 1 sampling unit. $\endgroup$ Commented Jul 26, 2023 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.