Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: GROUPED DATA LOGISTIC MODELS


From   "Antonio Rodrigues Andres" <[email protected]>
To   <[email protected]>
Subject   st: GROUPED DATA LOGISTIC MODELS
Date   Mon, 20 Oct 2003 10:09:43 +0200

Assume that my dependent variable is  Pj (proportion of crimes in
region i and time t). I want to estimate a grouped data logistic model
as follows

log (Pj/1-Pj) =X1* alpha_i +X2**Bj + epsilon


In STATA you type

gen ratio= Pj/1-pj
gen lratio=log(ratio)

regress lratio stats race

Next step
you need fitted probabilities

gen lp =constant + coefficient estimated* X1 + coefficient *x2 % this
may be generated using the command predict in the above regression

gen elp =exp(lp)
gen fp= elp/1+elp

and then you can correct by heteroskedasticity using weigthed least
squares
taking as weights the inverse of the variances

regress lratio stats race [aw=weights]

Is that correct?

I would appreciate your help 
Regards
Antonio



 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index