Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: adding observation of means of variables

From   Phil Clayton <>
Subject   Re: st: adding observation of means of variables
Date   Thu, 16 Feb 2012 22:45:54 +1100

Not as far as I know, but it's easy to program. Here's one solution:

collapse (mean) *
tempfile means
save `means'
append using `means'

The above assumes that all variables are numeric. If they're not, you could replace:
collapse (mean) *
ds, has(type numeric)
collapse (mean) `r(varlist)'


On 16/02/2012, at 10:33 PM, Abhimanyu Arora wrote:

> Dear statalist
> Is there a direct command that appends an observation to the dataset,
> giving the means of all the numeric variables?
> Perhaps I am using -findit- not that efficiently, but if I am not
> mistaken there was one...
> Cheers
> Abhimanyu
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index