[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: linear interpolation
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.
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.
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: