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

st: Averaging within a variable


From   "kelly johnson" <[email protected]>
To   [email protected]
Subject   st: Averaging within a variable
Date   Tue, 12 Jul 2005 21:50:59 -0400

Hi,

Quick question: suppose I have a variable like this:


N Var1

1 12
2 45
3 65
. .
. .
. .
100 15

How can I create a new variable whose first observation is the average of Var1[1] and Var1[2], second observation is the avaerage of Var1[3] and Var1[4], etc. There will be a total of 50 observations for this new variable. Thanks in advance!

Kelly

_________________________________________________________________
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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index