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

st: RE: egen rskew()

From   "Nick Cox" <>
To   <>
Subject   st: RE: egen rskew()
Date   Tue, 20 Apr 2004 12:41:09 +0100

I am not aware of any such. 

One strategy is to -reshape-, use -egen, skew()- 
and -reshape- back again. 

Another is to do something like this, assuming 
the number of variables concerned to be less 
than the number of observations. 

gen holddata = . 
gen rskew = . 

local nvars : word count <spelled out variable list> 
tokenize <spelled out variable list> 

qui forval i = 1/`=_N' { 
	forval j = 1/`nvars' { 
		replace holddata = ``j''[`i'] in `j' 
	sum holddata, detail 
	replace rskew = `r(skewness)' in `i' 


Mark Clatworthy
> Does anyone know if there is a row function which will 
> generate the skewness of
> a variable across observations, sort of equivalent to the 
> rsd() row standard
> deviation under egen?

*   For searches and help try:

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