Announcement

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

  • #16
    Following Carlo's track, I wonder whether a survey design - svy + weights - would'nt fit with your needs.
    Best regards,

    Marcos

    Comment


    • #17
      Carlo, thank you! I did, but I am not finding the specific answer. Let me be more specific: In my dataset the male frequency is 61.19% and the female frequency is 38.81%. Instead, the INSTAT offers male and female as 51.52% and 49.48% of the population respectively. How can I create a new variable that would represent the male and female frequencies for the population? Any response would help...

      Comment


      • #18
        Marco, I have a simple random sample collected via a cellphone RDD. Apparently, Albanian females use less cellphone, and we have less females than males in our sample. The problem is that the discrepancy between my female/male ratios and that of the population is problematic to my dependent variables. For instance, I am finding that Albanian female feeling temperatures toward Greeks as significantly lower than those of Albanian males, and that impacts the means unless I find a way to weight this variable in a way that it would reflect the population weights.

        Also, I am not sure Ii understood your suggestion: could you be a bit more specific with it?

        Best,
        Ridvan

        Comment


        • #19
          Ridvan:
          Marcos wisely pointed you to the -svy- design (although I cannot actually get whether your research is based on a survey or other sample design).
          Be as it may, I think -weights- can give you some clues to elaborate on.
          In the following toy-example, I arbitarily assume that the population from which the sample of car reported in -auto.dta- is equally composed of -domestic- and -foreign- cars (whereas the sample is 70.27% in favour of -domestic- ones):
          Code:
          . sysuse auto.dta
          (1978 Automobile Data)
          
          . tab foreign
          
             Car type |      Freq.     Percent        Cum.
          ------------+-----------------------------------
             Domestic |         52       70.27       70.27
              Foreign |         22       29.73      100.00
          ------------+-----------------------------------
                Total |         74      100.00
          
          . g prob=0.50 if foreign==0
          (22 missing values generated)
          
          . replace prob=0.50 if foreign==1
          (22 real changes made)
          
          . regress price mpg i.rep78 [pw=1/prob]
          (sum of wgt is   1.3800e+02)
          
          Linear regression                               Number of obs     =         69
                                                          F(5, 63)          =       5.77
                                                          Prob > F          =     0.0002
                                                          R-squared         =     0.2584
                                                          Root MSE          =     2605.8
          
          ------------------------------------------------------------------------------
                       |               Robust
                 price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   mpg |  -280.2615   61.23892    -4.58   0.000    -402.6377   -157.8853
                       |
                 rep78 |
                    2  |   877.6347   1061.865     0.83   0.412    -1244.334    2999.603
                    3  |   1425.657   649.6622     2.19   0.032     127.4107    2723.903
                    4  |   1693.841   583.9808     2.90   0.005     526.8484    2860.834
                    5  |   3131.982   840.6517     3.73   0.000     1452.074    4811.891
                       |
                 _cons |   10449.99   1332.468     7.84   0.000     7787.266    13112.72
          ------------------------------------------------------------------------------
          PS: Ridvan: I've just read your reply about a simple random sample. Hence, no survey design. I do hope that what above can contribute to your point-to-point reply to reviewers.
          Last edited by Carlo Lazzaro; 04 Nov 2017, 07:48.
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #20
            Carlo, thank you so very much. I sense that this is exactly what I needed. However, I would humbly beg for a bit more of your time. Actually I am running tobit models, but I am not sure I want to use weights in the regression analysis. I would rather use them only in the descriptive statistics. However, in the case I decide to use weights in the models, do I need to add the [pw=1/prob] expression, or is it specific to the mock dataset that you used? Any response would help...
            Best,
            Ridvan

            Comment


            • #21
              Ridvan:
              -[pw=1/prob]- notation was retrieved from an example reported in -help weights-.
              Obvioulsy, you can rename -prob- as you prefer.
              Kind regards,
              Carlo
              (Stata 18.0 SE)

              Comment


              • #22
                Carlo, again, I got myself the meaning of the [pw=1/prob]. However, when I use it to the sum command, it does not recognize it. How can I use the new prob variable to measure the weighted mean? Sorry for all this fuss...

                Comment


                • #23
                  Again, I need the mean of another variable (feeling temperatures toward Greeks, say) that has been affected by the lopsided number of males in my Sex variable. Now, how can I use the prob variable to assess that mean?
                  Humbly,
                  Ridvan

                  Comment


                  • #24
                    Ridvan:
                    the only Stata official command suitable for descriptive statistics that supports -pweights- is -mean-.
                    However, it does not return a standard deviation, but a standard error.
                    Kind regards,
                    Carlo
                    (Stata 18.0 SE)

                    Comment


                    • #25
                      Carlo, okay, great, Ii was able to perform what I needed. I am sooooooo grateful of your help. Thank you, thank you, thank you!

                      Comment


                      • #26
                        Ridvan:
                        my pleasure.
                        All the best for your re-submission.
                        Kind regards,
                        Carlo
                        (Stata 18.0 SE)

                        Comment


                        • #27
                          Carlo, I do have one more question. I did generate two weighed variables, one of them that weights the age groups (wgtage) and the other sex (wgtsex). Then I estimated the mean for another variable, FTGr (feeling temperatures toward Greeks).
                          . mean FTGr [pw = 1/wgtage & 1/wgtsex]

                          However, the estimated means that I received is the same with what I receive with mean FTGR. I do receive different estimated means though if I condition the command with only one of those variable weights (either [pw = 1/wgtage] or [1/wgtsex]). Am I missing something with the command?

                          Comment


                          • #28
                            Dear Carlo and/or Marco (and/or anybody else),
                            After I spent my entire day looking for answers beyond what Carlo gave me earlier today, I am back with one more question. I am using a simple random sample, and want to estimate the mean of a variable (FTGr - Feeling temperature toward Greeks) using quite a few weights (generated following some frequency estimation of population strata). Following Carlo's advise, I generated a couple weights. I am able to estimate a weighted mean for the FTGr variable using only one of those weights (for instance, I receive weighed FTGr if I run the command mean FTGr [pw = 1/wgtage], but am not able to acquire any weighted FTGr mean if I add a second weight. In this case, the command mean FTGr [pw = 1/wgtage & 1/wgtsex] only gives me the unweighted FTGr. What I got wrong? Can I use more than one weight in estimating the mean? If so, what command should I apply?
                            Best,
                            Ridvan

                            Comment


                            • #29
                              Ridvan, if I understand correctly, you wish to apply ‘several’ weights in the same model. Unless this is a multilevel model - and it seems not to be - or a survey - and it also seems not to be - , the OLS regression won’t probably cope with ‘weighting’ in a row.

                              On a risky note, perhaps you may try weighted least-squares linear regression. I have no practical experience with it but, in short: the command is - regress - with the - noconst - option; yvar as well as xvars can be ‘weighted ‘ by generating new vars (example: gen yvar2 = weightvar*yvar1; gen xvar2 =xvar1*weightvar; finally: reg yvar2 xvar2 weightvar, noconst).

                              I strongly suggest to take a close look at the literature.

                              I’m afraid I’m not the best person to help you further, for at least two reasons: first, I guess the ‘selection’ of weights here is fundamentally a ‘post-hoc’ strategy to make, say, ‘ends meet’, not necessarily the search for the most appropriate model; second, because I haven’t yet used WLS in my ‘real life’ models, that would be daredevilness of mine, which is against my nature. Hence, hopefully that helped you!
                              Last edited by Marcos Almeida; 04 Nov 2017, 17:04.
                              Best regards,

                              Marcos

                              Comment


                              • #30
                                Thank you very much, Marcos. That was extremely helpful.
                                Best,
                                Ridvan

                                Comment

                                Working...
                                X