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

st: RE: calculating skew and sorting from frequency data

From   "Nick Cox" <>
To   <>
Subject   st: RE: calculating skew and sorting from frequency data
Date   Tue, 28 Oct 2008 14:41:51 -0000

If I understand this correctly, something like this may suit: 

forval i = 1/198 { 
	qui su ps [aweight = spl`i'], detail 
	di %3.0f `i' %10.3f r(skewness) %10.3f r(kurtosis) 


P.S. "sorting" is sedimentology-speak for variability, but Alona asks
for skewness and kurtosis. If she wants other measures too, modify the
-display- above. 

Armstrong, Alona

I have some particle size data with a class size column (called 'ps'
with 50 or 100 classes) and 198 columns with frequencies in for
different samples. I need to calculate the skewness and kurtosis for
each of the samples. I've done this for individual samples by:
summarize ps [aweight = spl1], detail 
Or perhaps more neatly:
tabstat ps [aweight = spl1], statistics( kurtosis skewness )
But, what I really need is either a dataset or a table for all 198
samples at once? I've looked at xcontract/xcollapse but these don't seem
to have a skew and kurtosis option.

*   For searches and help try:

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