Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: a question on t-test


From   Richard Williams <Richard.A.Williams.5@ND.edu>
To   statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu
Subject   Re: st: a question on t-test
Date   Fri, 20 Jun 2008 18:09:05 -0400

At 04:38 PM 6/20/2008, Lili Yan wrote:
Hi Richard,

Thank you very much for your prompt response! I did not use -ttest-
for several reasons:

First, I actually have a weight variale in my data and -ttest- does
not allow weights.
Second, I need compare means of many variables, so I want to quietly
run means calculation and comparison, then generate a table with -mat-
commands. In that table, I want to see p-value. So I have to calculate
it as Stata does not save it.
OK, first off, using lincom seems to be the equivalent of running a t-test with the unequal variances option. Run this code:

sysuse auto
mean mpg, over(foreign)
lincom [mpg]Domestic-[mpg]Foreign
ttest mpg, by(foreign)
ttest mpg, by(foreign) unequal

Second, what about just running

reg mpg foreign

A couple of people have suggested oneway or anova. Those might do the trick, but it depends on your weights, i.e. reg allows pweights but anova and oneway do not. Also, when you say "I need compare means of many variables" to me that sounds like you have multiple dependent variables rather than multiple groups. Maybe you want manova or mvreg or something like that.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW: http://www.nd.edu/~rwilliam

*
* 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/




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