Thank you Scott! Given that most of the scalars are in lower caps I kept
seeing r(var) in lower caps.
Best,
Nuno
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Merryman
Sent: sexta-feira, 23 de Novembro de 2007 22:09
To: [email protected]
Subject: Re: st: Issue with statsby
. sysuse auto
(1978 Automobile Data)
. sum mpg
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
mpg | 74 21.2973 5.785503 12 41
. return list
scalars:
r(N) = 74
r(sum_w) = 74
r(mean) = 21.2972972972973
r(Var) = 33.47204738985561
r(sd) = 5.785503209735141
r(min) = 12
r(max) = 41
r(sum) = 1576
The variance is return to r(Var) not r(var)
Scott
On Nov 23, 2007 4:03 PM, Nuno <[email protected]> wrote:
> Hi everyone,
>
> I have a file with over 5 million daily observations for a set of
> firms. The format is the following:
> id date var1
>
> I'm trying to produce a file that records the variance for each
> individual
> (id) using the following statsby command:
>
> statsby var=r(var), by(id) saving(c:\temp\var.dta, replace): sum var1
>
>
*
* 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/