Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: predicted proportions greater than 1 using -adjust- after GLM family(binomial) link (logit)


From   Gina Bilenkij <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: predicted proportions greater than 1 using -adjust- after GLM family(binomial) link (logit)
Date   Fri, 27 Feb 2009 11:12:57 +1100

Just some feedback- 

I have worked through the suggested code, and applied it to my data. The adjusted proportions are now far more realistic- Thanks

Have chased up some of the references. I think that a demand system approach is difficult as we do not have quantities or prices available to us- only dollars spent. (So this is a very basic analysis and naturally we can only draw limited conclusions)


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Gina Bilenkij
Sent: Wednesday, 25 February 2009 2:37 PM
To: [email protected]
Subject: RE: st: predicted proportions greater than 1 using -adjust- after GLM family(binomial) link (logit)

Your point about exp not being correct for the predicted proportion with a logit link is really helpful- I had wondered about that. I'll have a look at the references that you have suggested and see how it goes.

I'll also aim to work through your suggested code- as I said being reasonably new to stata and this field of study, it may take a while to get my head around it.

Thanks for your help,
Gina

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Austin Nichols
Sent: Wednesday, 25 February 2009 2:04 PM
To: [email protected]
Subject: Re: st: predicted proportions greater than 1 using -adjust- after GLM family(binomial) link (logit)

I mean:

sysuse nlsw88, clear
egen m=mean(married), by(race)
char _dta[omit] "prevalent"
qui xi: glm m i.age i.grade, family(bin) link (logit) r
unab v: _Igrade*
loc s
foreach i of loc v {
 loc s "`s' `i'=0"
 }
preserve
qui adjust `s' if e(sample), by(age) se replace
g p=invlogit(xb)
g ub=invlogit(xb+1.96*stdp*abs(1/xb-1/(1-xb)))
g lb=invlogit(xb-1.96*stdp*abs(1/xb-1/(1-xb)))
di as res "Adjusted for grade; predictions at grade=12"
li age p lb ub, noo sep(0)
restore
di as res "Unadjusted means by age"
mean m, over(age) nohe

and I would add an alternative calculation predicting over the whole
sample replacing age with each observed value of age in turn, but it
would make no difference in this silly example using faked data.

In any case, better to go down the demand system route:
http://www.stata-journal.com/sjpdf.html?articlenum=st0029
and see also
http://www.stata.com/meeting/snasug08/nelson_snasug08.pdf
ata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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