Statalist The Stata Listserver


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

RE: st: how to create average income of same cohorts?


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: how to create average income of same cohorts?
Date   Tue, 15 May 2007 17:54:39 -0500

An alternative:

clear
input id region educ age income
1       2       1       25      5
1       2       1       26      5
2       2       1       29      8
2       2       1       30      8
3       2       1       32      11
3       2       1       33      11
4       1       1       40      5
4       1       1       41      5
5       1       2       37      8
5       1       2       38      8
6       1       2       42      9
6       1       2       43      9
end

egen group = group(region educ)
tsset group age
tsfill, full
tssmooth ma ref= income, w(5 1 5)
keep if id !=.
sort id edu age
l


Scott

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Mirko
> Sent: Tuesday, May 15, 2007 5:00 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: how to create average income of same cohorts?
> 
> William,
> thanks a lot for all the work you have done on this.
> Yes, I've actually made a stupid mistakes in the datasets I reported
> as examples.
> (in practice the first matrix of data has different age values than
> the second one...pity on me!...
> So the income averages yref I use in the example are based on the
> first age values, not on the second).
> Thank you also because you understood perfectly what I meant even if
> there was that example
> So I really think your do file is gonna work. I am gonna try.
> Cheers,
> Mirko


*
*   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