Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: t-test query


From   "Mirnezami, Oliver" <O.Y.Mirnezami@warwick.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: t-test query
Date   Fri, 19 Apr 2013 13:34:07 +0000

Hello

I am trying run a series of difference in means tests using the code below. How can you add some sort of label to show which variable the test refers to? Stata just does one test after another after another but doesn't label. I guess I can go through the order of the variables but would be nice if it was clearly labelled. I've had a look through the help guide but can't find a way to do this. I've included just a few variables here but I wish to run this for many and so it's difficult to identify which variables are in which test otherwise. 

local varlist health married hispanic college 
local yeareffects  y1994 y1996 y1998 y2000
local controls married hispanic college

xtreg health `controls `yeareffects' , fe vce(cluster id)
gen sample4 = e(sample)
forval i = 4/4 {
foreach j in `varlist' { 
ttest `j' if (sample4 ==1), by(treatment) unequal 
}
}

Thank you

Oliver 



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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