Announcement

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

  • Exact Logistic Regression after Inverse Probability Weighting

    I am trying to run several exact logistic regressions after using inverse probability weighting; however, I am getting the error "may not use noninteger frequency weights". Is there a work around? I am using exact logistic regression instead of logistic regression due to sample size concerns.

    Here is my code:
    Code:
    exlogistic var1 treatment [fw=atewgt2]
    Appreciate the help.

  • #2
    Even if you had integer weights, I don't think frequency weights is the right approach. As described in help weight, frequency weights "indicate the number of duplicated observations." In other words, using frequency weights is equivalent to multiplying the number of observations by the value of the weight, which is not appropriate in this case because it would be duplicating observations that should not be duplicated.

    Here is a silly example to illustrate this equivalence:
    Code:
    . sysuse auto
    (1978 automobile data)
    
    . logistic foreign price mpg rep78 [fw=weight]
    
    Logistic regression                                  Number of obs =   209,210
                                                         LR chi2(3)    = 104860.86
                                                         Prob > chi2   =    0.0000
    Log likelihood = -59676.04                           Pseudo R2     =    0.4677
    
    ------------------------------------------------------------------------------
         foreign | Odds ratio   Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           price |   1.000137   2.66e-06    51.65   0.000     1.000132    1.000142
             mpg |   1.233198   .0021727   118.97   0.000     1.228947    1.237464
           rep78 |   7.643778   .0842694   184.49   0.000     7.480384     7.81074
           _cons |   8.95e-07   5.81e-08  -214.41   0.000     7.88e-07    1.02e-06
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline odds.
    
    . expand weight
    (223,366 observations created)
    
    . logistic foreign price mpg rep78
    
    Logistic regression                                  Number of obs =   209,210
                                                         LR chi2(3)    = 104860.86
                                                         Prob > chi2   =    0.0000
    Log likelihood = -59676.04                           Pseudo R2     =    0.4677
    
    ------------------------------------------------------------------------------
         foreign | Odds ratio   Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           price |   1.000137   2.66e-06    51.65   0.000     1.000132    1.000142
             mpg |   1.233198   .0021727   118.97   0.000     1.228947    1.237464
           rep78 |   7.643778   .0842694   184.49   0.000     7.480384     7.81074
           _cons |   8.95e-07   5.81e-08  -214.41   0.000     7.88e-07    1.02e-06
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline odds.
    David Radwin
    Senior Researcher, California Competes
    californiacompetes.org
    Pronouns: He/Him

    Comment

    Working...
    X