Talking of -glm-, as I have been for most of this week, I've come across a
frustrating error when attempting to fit one of my own models.
Essentially, I'm trying to get -glm- to fit OLS Newey-West models with
automatically logit-transformed estimates, which -help glm- implies that
it can do.
I've recreated the problem using one of Stata 9's toy datasets. Below,
-unemp- is the unemployment rate, -region- is a continuous variable with
no upper limit:
. tsset state year
panel variable: state (strongly balanced)
time variable: year, 1970 to 1986
. glm unemp state public, link(logit) vce(hac nwest 1) t(year) robust eform
repeated time values in sample
r(451);
It fails miserably. Deleting -robust- makes no difference; the -t()-
option must be specified as -vce(hac ...)- is also specified, as per -help
glm-. But I don't know why it fails, because when I use
Baum/Schaffer/Stillman's -ivreg2-, from SSC, to fit pretty much the same
model:
. g logunemp=ln((unemp/100)/(1-(unemp/100)))
. ivreg2 logunemp state public, bw(2) robust small eform(OR)
OLS estimation
--------------
Statistics robust to heteroskedasticity and autocorrelation
kernel=Bartlett; bandwidth=2
time variable (t): year
group variable (i): state
Number of obs = 816
F( 2, 813) = 20.14
Prob > F = 0.0000
Total (centered) SS = 102.2836463 Centered R2 = 0.0434
Total (uncentered) SS = 6067.674132 Uncentered R2 = 0.9839
Residual SS = 97.8449067 Root MSE = .3469
----------------------------------------------------------------------------
| Robust
logunemp | OR Std. Err. t P>|t| [95% Conf. Interval]
-----------+----------------------------------------------------------------
state | .9987938 .0011866 -1.02 0.310 .9964672 1.001126
public | 1.000003 4.15e-07 6.11 0.000 1.000002 1.000003
----------------------------------------------------------------------------
Included instruments: state public
----------------------------------------------------------------------------
Now how is it that -ivreg2- can fit pretty much the same model as I've
asked -glm- to, and yet -glm- chokes?
Answers, please!
CLIVE NICHOLAS |t: 0(044)7903 397793
Politics |e: [email protected]
Newcastle University |http://www.ncl.ac.uk/geps
Whereever you go and whatever you do, just remember this. No matter how
many like you, admire you, love you or adore you, the number of people
turning up to your funeral will be largely determined by local weather
conditions.
*
* 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/