From | Heather Gold <[email protected]> |
To | [email protected] |
Subject | Re: st: count (Stata 8) |
Date | Tue, 10 May 2005 12:18:23 -0400 |
At 11:44 AM 5/10/2005, I wrote:
Thanks for the replies thus far.NO - this isn't a problem. This scalar approach works just an error on my part...
I'd prefer a scalar so I don't have to generate the extra variables with a value attached to each subject.
Based on all the comments you have generously offered, I'm closer to a solution:
forvalues i=1995/1998 {
count if dxflag==1 & year==`i'
scalar cases`i' = r(N)
count if year==`i'
scalar total`i' = r(N)
scalar prev`i' = cases`i'/total`i'
}
The problem is this doesn't give me different denominators (ie, total for each year)...thoughts?
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |