Announcement

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

  • little help with svyset

    I'm working on a little project to practice while reading the survey manual, but I'm hitting a wall with this code:

    svyset district
    pweight = tfnlwgt
    brrweight: TREPWT1-TREPWT200
    VCE: brr

    returns:

    command pweight is unrecognized
    r(199);


    I've tried square brackets and a coma and it keeps blowing up on line 2. Hopefully this doesn't violate the "too elementary" proviso.

  • #2
    You need to read the Getting Started [GS] and User's Guide [U] volumes of the PDF documentation that comes with your Stata installation and learn the really introductory basics of Stata.

    You can't split a command over several lines this way. That is why it always breaks at the second line.

    There are several ways to issue a multi-line command in Stata, but all require some explicit notation that tells Stata that the next line is a continuation of this command, not a new one. You will learn about these in the readings I have recommended above.

    By the way, you will need square brackets around the pweight = tfnlwgt partof your command, but that won't save you here: Stata isn't even getting that far into it: it thinks you have issued a separate pweight command, which does not exist.

    Comment


    • #3
      Stratum and PSU information is captured in the replicates. Therefore, specifying a psu variable ( here "district") isn't necessary and will likely lead to erroneous results. For an example of the correct syntax, see the svyset statement on the first page of the Manual entry for svy brr.
      Last edited by Steve Samuels; 10 Jul 2018, 15:21.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        Thank you! I'll take another run at it. The manual is good but I'm pretty far down the learning curve and keep getting stuck on basic stuff. I'll print the getting started, I'm using the regular manual and the survey manual, but need to go back to the basics apparently...

        Comment

        Working...
        X