Announcement

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

  • Extract svy calibration weights

    Hi everyone,

    I need to calculate some general regression estimator (GREG) survey weights and save them as a variable. As far as I know there aren't any packages that would allow me to do that in Stata (unlike say ipfweight for raked weights). I do know though that you can calculate them using svyset. What I can't figure out is how to save the weights that get produced (or whether that is even possible).

    To give a really simple made up example of what I want to do, I want to save the weights that get used in the weighted mean estimate below as a variable:

    Code:
    set obs 1000
    
    gen x = rbinomial(1,.5)
    
    svyset, regress(x, totals(_cons=10000 x=6000))
    
    svy: mean x
    Thanks for any help!

    Chris

  • #2
    Hi, Chris,
    The new command svycal saves weights. If you don't have it yet, update your Stata copy.

    Comment


    • #3
      Ah brilliant, thanks Braulio, I hadn't spotted that had been added.

      Comment


      • #4
        Hi Braulio,

        I am trying to run the svycal command but I am getting an error message stating that this is an unrecognized command.

        Any advice as to where/how I can install this procedure/command ? as I need to test run some non probability sample.

        Thanks a lot in advance

        Comment


        • #5
          svycal is in Stata 15. Two contributed commands will also produce and save calibration weights: calibrate, by John DeSouza (SSC) and maxentropy, by Martin Wittenberg. You can find this in Stata by typing
          Code:
          net describe st0196, from(http://www.stata-journal.com/software/sj10-3)
          maxentropy is described in a Stata Journal article.
          Last edited by Steve Samuels; 08 Feb 2019, 10:24.
          Steve Samuels
          Statistical Consulting
          [email protected]

          Stata 14.2

          Comment


          • #6
            Thanks Steve, I am actually more interested in the [ svycal ] specifically as I am trying to replicate some work with this command .

            I am using STATA 15, so that should fine but still getting the same error message ( as per the attachment )

            Thanks in advance for any help


            Attached Files

            Comment


            • #7
              If you have the latest update,, perhaps your Stata is corrupted. You can re-download via this page.
              Last edited by Steve Samuels; 09 Feb 2019, 11:06.
              Steve Samuels
              Statistical Consulting
              [email protected]

              Stata 14.2

              Comment

              Working...
              X