Announcement

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

  • svyset fx doesn't allow different pweights for multiple levels?

    The Add Health survey has a complex design, and they provide two sets of weights for a 2 level model: one for the school level selection process and one for selection of individuals within schools: w3_2_wc is the individual level weight, and schlwt1 is the school level weight. psuscid is the school level sampling unit variable, and aid is the individual level ID variable.

    Using stata 14, I used this code, and received the error message shown:


    . svyset psuscid [pweight=schwt1], strata(region) vce(linearized) singleunit(missing) || aid [pweight=w3_2_wc]
    Note: Stage 1 is sampled with replacement; further stages will be ignored for variance estimation.
    sampling weights may only be specified once

    Also tried this, and got error:

    . svyset psuscid [pweight=schwt1], strata (region)///aid [pweight=w3_2_wc]
    option / not allowed

    When I try to use the drop-down box for svyset, there is a spot for a weight for each stage, but when I enter a weight for each stage, I get the error message: sampling weights and replication weights are not allowed with stage level weights.

    I appreciate any suggestions. Thank you.

    Barbara Wise

  • #2
    Your second example
    Code:
    . svyset psuscid [pweight=schwt1], strata (region)///aid [pweight=w3_2_wc]
    option / not allowed
    probably failed because of a syntax error. The "///" notation is used within do-files to denote continuation to a second line, but is not allowed in the command window, and when used there produces the "option / not allowed" message you received.

    I'm not sayaing that removing the "///" will answer your underlying question ... perhaps just a different error message, given your third example.

    Comment


    • #3
      The syntax for specifying multilevel weights uses a weight() option in each stage
      instead of the weight expression syntax.

      Here is the syntax using Barbara's example.

      Code:
       svyset psuscid, weight(scwt1) strata(region) vce(linearized) singleunit(missing) ///
              || aid, weight(w3_2_wc)
      The dialog for svyset provides edit fields for multilevel weights in the Main tab,
      but will report an error if you also specify any weights in the Weights tab because
      these two specifications are mutually exclusive.

      Comment


      • #4
        Thank you William and Jeff. I am very appreciative of you taking the time to help me. It worked! I am always amazed what a tiny little difference in syntax makes. I tried that exact syntax except I didn't put the comma between aid and weight, and it didn't work. I also did not realize that the /// was specific to the do-file but did not work in the command window.

        Barbara

        Comment

        Working...
        X