Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Average for panel data


From   SERGIO MOISES AFCHA CHAVEZ <[email protected]>
To   [email protected]
Subject   st: RE: Average for panel data
Date   Wed, 15 Jul 2009 20:34:30 +0200

Dear Martin Weiss,

Thanks for your fast response, but I think I explain my question badly:

In your solution:

gen newV3=sum(V3)/sum(V3!=.)

Sum (V3) is a sum of all observations, I have a panel data, so, the Id variable
continue with 2,3....3500 and I need the average variable for every 
individual in my database. I think I could obtain this with: 

by id: gen newV3=sum(V3[_n])

But, I don't know how continue with that, I need to divide this between the
number of the years with valid observation, and I don't know how express this
with STATA. 

Thanks,

Sergio
 






-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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