Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Predicting number of cases
From
Austin Nichols <[email protected]>
To
[email protected]
Subject
Re: st: Predicting number of cases
Date
Sun, 5 Dec 2010 08:32:38 -0500
Christiana Titaley <[email protected]>:
No, your understanding is wrong; there is no estimate for time 2, so
the only equation -predict- can possibly be using is based on time 1
estimates. It's still not clear to me what you intend doing, but
maybe you just want to show density estimates like below. See also
-oaxaca-, -jmpierce, -jmpierce2, and -dfl- on SSC, and references
therein for additional approaches; also
http://www.stata.com/statalist/archive/2009-07/msg00602.html
u if t==1 using http://www.stata-press.com/data/r11/psidextract, clear
g wage=exp(lwage)
qui poisson wage south smsa fem union ed blk
predict hat
keep t hat lwage wage
tempfile t1
save `t1'
qui forv i=2/7 {
u if t==`i' using http://www.stata-press.com/data/r11/psidextract, clear
predict hat`i'
keep t hat`i' lwage
g w`i'=exp(lwage)
append using `t1'
tempfile t1
save `t1', replace
}
tw kdensity hat||kdensity hat2||kdensity hat4||kdensity hat7
tw kdensity w4||kdensity hat4||kdensity w7||kdensity hat7
On Sun, Dec 5, 2010 at 12:31 AM, Christiana Titaley
<[email protected]> wrote:
> Hi Austin,
>
> Thank you for your response. What I want to do is to examine the
> trends of neonatal deaths across 5 surveys; whether the changes in the
> predictors included in the Poisson model contributed to the reduction
> of neonatal deaths over time.
>
> E.g, using the grunfeld dataset,
>
> u if time==1 using http://www.stata-press.com/data/r11/grunfeld.dta, clear
> poisson invest mvalue kstock, r
> predict hat
>
> This will give me the predicted number of hat for time 1 and also the
> predicted equation. I want to apply this equation (time 1) to the
> subsequent data (time 2, 3 ...) to get the predicted number of "hat"
> by controlling for the same set of predictors (mvalue, kstock). At the
> end, I will compare the observed and predicted numbers of hat.
>
> Please correct me if I'm wrong, but my understanding from the command
> below is it uses the equation from time 2, instead of time 1, to get the
> number of hat for year 2:
> u if time==2 using http://www.stata-press.com/data/r11/grunfeld.dta, clear
> predict hat
> li hat mvalue, clean
>
> Do you have any idea what command I can use to apply the first
> equation (time 1) to the subsequent survey data?
>
> Thank you very much.
>
> Christiana
>
>
> On Fri, Dec 3, 2010 at 12:00 AM, Austin Nichols <[email protected]> wrote:
>> Christiana Titaley <[email protected]> :
>> Use -predict- e.g.
>>
>> u if time==1 using http://www.stata-press.com/data/r11/grunfeld.dta, clear
>> poisson invest mvalue kstock, r
>> predict hat
>> li hat mvalue, clean
>> u if time==2 using http://www.stata-press.com/data/r11/grunfeld.dta, clear
>> predict hat
>> li hat mvalue, clean
>>
>> But can you explain the rationale for what you are doing?
>>
>>
>> On Thu, Dec 2, 2010 at 5:15 AM, Christiana Titaley
>> <[email protected]> wrote:
>>> Hi all,
>>>
>>> I have data from 5 subsequent health surveys. Using data from the
>>> first survey, I constructed a Poisson model using a set of potential
>>> predictors to examine factors associated with neonatal death. The
>>> final model gave me a predictive equation. Then I’d like to apply this
>>> predictive equation to the data from subsequent years to determine the
>>> predicted number of neonatal death cases. What command should I use
>>> for this?
>>>
>>> Thank you very much.
>>>
>>> Christiana
>>> University of Sydney
*
* 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/