Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting up weights using svyset (age, sex, and cluster = household)

    Dear statalisters,

    I want to perform an analysis on a sample which does not have the same distribution in terms of age and sex as the population from which it comes from.

    To achieve this, I've found out that "svyset" and "svy:" should be used, however I'm having some hard time finding the right way configuring the svyset prior to using "svy:"

    The participants in the study have a unique id (Codbar) and are clustered within households (hh_dp)

    Code:
    *First I start by defining weights for age and sex according to the population census (actual N)
    
    capture drop age_wt
    gen age_wt=.
    replace age_wt=105223 if agecl==1 //0-18y
    replace age_wt=143101 if agecl==2 //18-40y
    replace age_wt=148257 if agecl==3 //40-60y
    replace age_wt=110184 if agecl==4 //60+y
    
    capture drop sex_wt
    gen sex_wt=.
    replace sex_wt=245668 if Sex==1 //Men
    replace sex_wt=261097 if Sex==2 //Women
    
    
    *Then I try to implement the following, taking into account the fact that participants are grouped within households (hh_dp)
    
    svyset Codbar , strata(hh_dp) weight(age_wt sex_wt)
    
    
    *But then STATA returns an error as only one weight variable is accepted
    *I then generated a combined weight
    
    gen combined_weight=sex_wt*age_wt
    
    svyset Codbar , strata(hh_dp) weight(combined_weight)
    
    *Which works

    Yet I am wondering whether this svyset command is correct for what I want (weighted age and sex according to population census, accounting that participants are grouped within households)?
    Plus, I am not sure whether I should use weight or postweight()?
    Finally, should I have used survwgt at some point ?



    I know that this issue has been discussed previously STATALIST but I failed to get a complete response to my question.

    Your help is appreciated

    Thanks a lot
Working...
X