Announcement

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

  • descriptive statistics with svy

    Hi Folks,

    I'm doing a cross-sectional analysis with one wave of a german Panel study.
    I weighted my data with

    Code:
    svyset [pweight=d1ca1weight]
    (a combined design and a poststratification weight)

    Now I wanted to use tabstat to see my descriptive statistics as follows:

    Code:
    svy: sum allg_lz erw job kohorte partner ost gesund loghheinknett_z migstat abschluss anz_kind kind_u3_nodum
    svy: estpost tabstat allg_lz erw job kohorte partner ost gesund loghheinknett_z migstat abschluss anz_kind kind_u3_nodum, casewise ///
      statistics(count mean sd median min max) column(statistics)
    But that doesn't seem to work since svy doesn't support sum or tabstat.
    How can I see the descriptive statistics (count mean sd median min max) with svy for a cross-sectional Analysis?

    Thanks a lot!

    Greetings,
    Guest
    Last edited by sladmin; 08 Jul 2019, 15:58. Reason: anonymize original poster

  • #2
    Guest:
    you may find https://stats.idre.ucla.edu/stata/se...d-svy-stata13/ useful.
    Last edited by sladmin; 08 Jul 2019, 15:58. Reason: anonymize original poster
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Thanks, thats helpful!

      So I can derive count, median, min and max from the proportions, at least for the categorial variables. Is there a possibility to see the median for a contiuous variable except for summing up all the tiny proportions?
      And is there a way to get the word output for the results like estpost?

      Kind regards, Guest (Stata 15.1)
      Last edited by sladmin; 08 Jul 2019, 15:58. Reason: anonymize original poster

      Comment


      • #4
        Guest:
        as far as your first question is concerned, see https://www.stata.com/support/faqs/s...r-survey-data/.
        Unfortunately, I cannot help with reference to the second one. Sorry for this.
        Last edited by sladmin; 08 Jul 2019, 15:58. Reason: anonymize original poster
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          If you need survey-adjusted standard errors for percentiles, you can try epctile by Stas Kolenikov. In my experience it works sometimes but not always.

          . findit epctile

          Another option for creating tables of statistics, somewhat similar to estpost, is tabout by Ian Watson.

          . ssc describe tabout
          David Radwin
          Senior Researcher, California Competes
          californiacompetes.org
          Pronouns: He/Him

          Comment


          • #6
            Hello David,
            thanks for your reply. Unfortunately, tabout doesn't work with pweights/svy either.
            Is there another option?

            Kind regards,
            Guest
            Last edited by sladmin; 08 Jul 2019, 15:59. Reason: anonymize original poster

            Comment


            • #7
              the help file for tabout says it allows pweights and also points to a "svy" option and shows examples using this option; are you sure you have the most recent version?
              Code:
              . which tabout
              /Users/rich/Library/Application Support/Stata/ado/plus/t/tabout.ado
              *! 2.0.8 Ian Watson 15mar2019
              *! tabout version 3 (beta) available at: http://tabout.net.au
              please show, as the FAQ requests, exactly what you typed and how Stata responded (within CODE blocks)

              Comment


              • #8
                Hi Rich, you're right, the help file for tabout says so but the help file for svy doesn't. I don't know why.

                I typed
                Code:
                svy: tabout allg_lz mum
                and Stata responded

                Code:
                tabout is not supported by svy with vce(linearized); see help svy estimation for a list of Stata estimation commands that are supported by svy
                r(322);

                Comment


                • #9
                  you are misreading the help file - open it and go to the bottom just before the acknowledgements - there you will see examples of the use of "svy"; note that your data must be -svyset- for the "svy" option to be used

                  added in edit - the help for -svy- will not include tabout as it is a user-written contribution

                  Comment


                  • #10
                    i "svysetted" my data with
                    Code:
                    svyset [pweight=d1ca1weight]
                    before using svy. The data Manual of my data set says I'm supposed to treat poststratification weights and combined weights as design weights.
                    is there more i have to do to properly svyset my data set?

                    Greetings

                    Comment


                    • #11
                      Perhaps you do have more to do, but it is impossible to tell without knowing more about the dataset. Does the manual include weighting syntax for any statistical software package at all? If not, have you tried contacting the dataset creator or distributor? Have you tried replicating some published results (including standard errors) using this syntax?
                      David Radwin
                      Senior Researcher, California Competes
                      californiacompetes.org
                      Pronouns: He/Him

                      Comment


                      • #12
                        I think I solved my problems, thanks everybody!

                        Comment


                        • #13
                          I solved the problem myself, thanks

                          Comment


                          • #14
                            How? Thanks.
                            Kind regards,
                            Carlo
                            (Stata 18.0 SE)

                            Comment


                            • #15
                              I found the answer in a help dofile provided by the data set. Svysetting the data like I did is enough, but I guess there could be other rules for other data sets.
                              Greetings

                              Comment

                              Working...
                              X