Announcement

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

  • CQUAD with weights

    Does anyone know if it possible to run cquad with weights?

  • #2
    I do not use cquad which is from SSC (FAQ Advice #12). Look at the syntax and see if it allows weights. For regress, you see this from the documentation

    Code:
    h regress
    regress depvar [indepvars] [if] [in] [weight] [, options]
    In case it does not, then with frequency weights, you can expand the data as below:

    Code:
    webuse hanley
    roctab disease rating [fw=pop]
    preserve
    expand pop
    roctab disease rating
    restore
    Res.:

    Code:
    . webuse hanley
    
    .
    . roctab disease rating [fw=pop]
    
                          ROC                    -Asymptotic Normal--
               Obs       Area     Std. Err.      [95% Conf. Interval]
         ------------------------------------------------------------
             2,513     0.9886       0.0018        0.98516     0.99209
    
    .
    . preserve
    
    .
    . expand pop
    (2,404 observations created)
    
    .
    . roctab disease rating
    
                          ROC                    -Asymptotic Normal--
               Obs       Area     Std. Err.      [95% Conf. Interval]
         ------------------------------------------------------------
             2,513     0.9886       0.0018        0.98516     0.99209
    
    . 
    . restore


    For other kinds of weights, a workaround may not be straightforward.

    Comment

    Working...
    X