Announcement

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

  • Testing with sampling weights

    Hi Statalist,

    I'm trying to estimate the effects of a given program on the knowledge of a recently passed law.

    Since I do not have a treatment and control group with information before and after the law, I am simply making mean differences between before and after the implementation of the law. I know this has infinite limitations, but we don't have more information.

    The data has sampling weights.

    To compare the mean knowledge between men and women, the model is:
    Code:
    reg knowledge time if sex==1 [pw=sampling_weight] // For men.
    reg knowledge time if sex==2 [pw=sampling_weight] // For women.

    Where the coefficient of the time variable (1 after the law and 0 before the law) captures the variation (test) for each sex separately, depending on the "if sex==1/2".

    My question is that I would like to compare whether the variation in knowledge of men and women is statistically significant (ie, compare the coefficients of the time variable for both regressions). However, I have not been able to do it with this code, since the suest throws me an error due to the type of weights used.
    Code:
    reg knowledge time if sex==1 [pw=sampling_weight] // For men.
    est store regre_1
    reg knowledge time if sex==2 [pw=sampling_weight] // For women.
    est store regre_2
    suest store regre_1 regre_2
    Error: model regre_1 was estimated with pweights, you should re-estimate using iweights
    
    lincom [regre_1]time - [regre_2]time
    Do any of you know how to do this?
    I am currently using Stata 17.

    Thanks in advance,
    Isidora.

  • #2
    I see several options, which I briefly give here in no particular order:

    1. suest works with data that have been svyset - have you done that; see "Using suest with survey data" in
    Code:
    h suest
    2. why not use an interaction term and just have one model?

    3. you could always do what the error message says and substitute "iw" for the "pw" in your command

    Comment

    Working...
    X