Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Averaging across variables


From   [email protected]
To   [email protected]
Subject   Re: st: Averaging across variables
Date   Thu, 14 Jul 2005 09:30:23 -0400 (EDT)

Hi,

I am not sure whether this is what you want. Suppose you have income
varialbe named inc78, inc79 and inc80. You created a new variable called
avginc which is the mean of (inc78 - inc80).  You use this command.

egen avginc = rmean(inc78 - inc80)

Do a search on Stata by "egen".

Good luck.



Ying




> hi folks,
>
> suppose i have a data set with say, many variables.
>
> how can i create a new variable that is the (arithmetic) mean of all the
> variables starting with certain letters (i.e. using the '*' operator)?
>
> thanks again!
>
> kj
>
> _________________________________________________________________
> Don�t just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> *
> *   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/
>


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