Announcement

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

  • Advice on SAS equivalent STATA command

    Hello,
    I am working with a national database (Asthma Call Back Survey) that has detailed information on reweighting files. The reweighting documentation recommends a proportional re-weighting to create new sample weights (which I have created).

    Once I create the new weight, the documentation asks us to do the following in SAS:
    1. Create a new variable (SURVYEAR) that identifies the year of the data file for each record.
    2. Add SURVYEAR to the strata statement in SAS SURVEYXX. This accounts for the fact that each year is from a different sample or strata.

    Can someone please tell me how to replicate Step 2 in STATA. I do not know where to accommodate the survey year variable in the svyset statement.

    My current svyset statement looks like this:
    svyset _psu [pweight=new_wt], strata(_ststr)


    Thanks,
    Maithili

  • #2
    You'll increase your chance of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data. You will do better by telling us what the objective is rather than asking us to interpret a SAS instruction.

    I'm afraid that I don't work with survey estimators. Have you carefully read the survey documentation?

    Comment


    • #3
      If the strata option allows two variables, you can do
      strata(survyear _ststr) or
      create a variable that combine survyear and _ststr. Usually multiply survyear by enough orders of magnitude to account for the maximum value of _ststr and add them:
      generate long newstrat = survyear*100000 + _ststr
      and then use newstrat as the stratum indicator

      Comment

      Working...
      X