Statalist


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

Re: st: significance of mean and median


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: significance of mean and median
Date   Sun, 30 Nov 2008 10:54:34 -0500

<>
Maarten, The two-sided significance level is OK, but the one-sided levels are not.

Add to your program
return scalar t = r(t)

and to the do-file

gen sig_p = p<.05 & sign(t) == 1
gen sig_n = p<.05 & sign(t) == -1


-Steve
On Nov 26, 2008, at 1:48 PM, Maarten buis wrote:

--- "Lachenbruch, Peter" <[email protected]> wrote:
In general, I've found that bad skewness/asymmetry messes up
significance tests more than heavy tails.  I know I read this
somewhere long ago, and it seems to work pretty well.

Interesting, I tried this using a simulation where I use a t-test on a
chi-square distribution with 3 degrees of freedom, which is quite
skewed, but the t-test seems to perform just fine:

*----------------- begin example -------------
set more off

capture program drop sim
program define sim, rclass
	drop _all
	set obs 500
	gen chi2 = rchi2(3)
	ttest chi2 = 3
	return scalar p = r(p)
end
simulate p=r(p), reps(50000): sim
hist p
gen sig  = p < .05
sum sig
*--------------- end exampele -------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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