Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: linear interpolation


From   Scott Cunningham <scunning@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: linear interpolation
Date   Tue, 25 Jul 2006 17:18:24 -0400


then you need to create some kind of an id variable for each such identified group, and then to -tsset id year- and finally – tsfill-. see help on -egen- with the group option to accomplish this task. note that it is quite likely to have, let's say, two white males aged 25 in the state of georgia so again the tsset based on id may fail. i am surprised you do not have something like a unique case id.
This worked. Now I've got to fill in the values for age, race, sex and fip for each of the news created so that only the incarceration rate data is missing. Is there a way to sort the data so that assignments can be made by those four categories rather easily? I need to, for instance, -replace age=15 if age==." but only for a certain number since I also have age=20, 25, 30, and so on that I have to fill in.

I may be having such a hard time with merging these two datasets precisely because I lack a group indicator variable that is unique. The unique case id needs to be created by me, I'm guessing, because what I've got is data by state and year on 9 different age cohorts, both sexes and two races for incarceration rates and gonorrhea rates. they're in separate datasets, and so I have to merge them, but I've also got to linearly interpolate the incarceration rate data before I can do that. I have not really figured out the most efficient way to do this, and probably the lack of a unique case id is a problem I've not known I've had. I was able to reshape the data, but had not been able to tsset it until you and Scott M. pointed out egen. *
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index