Statalist The Stata Listserver


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

Re: st: linear interpolation


From   [email protected]
To   [email protected]
Subject   Re: st: linear interpolation
Date   Tue, 25 Jul 2006 16:00:09 -0500

----- Original Message -----
From: Scott Cunningham <[email protected]>
Date: Tuesday, July 25, 2006 3:46 pm
Subject: Re: st: linear interpolation
To: [email protected]

> On Jul 25, 2006, at 4:26 PM, [email protected] wrote:
> 
> > Perhaps -tsfill- would help?
> 
> Scott,
> 
> I think -tsfill- must be right.  The problem I'm having is that 
> the  
> panel I'm creating has, as an indicator variable, four variables:  
> 
> state name, age cohort indicator, race and sex.  So, for instance, 
> 
> when I reshape the data, I use a nested reshape like this:
> 
> . reshape wide ir, i(fip age race sex) j(year)
> 
> But when I attempt to -tsset- the data, I can't seem to use the 
> same  
> kind of nesting.  When I simply use -tsset-, I use this:
> 
> . tsset fip year
> repeated time values within panel
> r(451);
> 
> Do you have any thoughts on this?
> 

If your panelvar is actually made up of four variables then you will 
need to create a single variable for the groups formed by fips, age, 
race, and sex.

For example:
egen id = groups(fip age race sex)
tsset id year
tsfill (or tsfill, full)


Scott


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index