<>
webuse grunfeld,clear
keep if year<1938
su invest, mean
g hi = (invest > `r(mean)')
forv i=1935/1937 {
ttest mvalue if year==`i', by(hi)
}
reg mvalue i.year##i.hi
// regression provides same point estimates as t-tests per year
lincom 1.hi+1936.year#1.hi
lincom 1.hi+1937.year#1.hi
// joint test that all three means are equal across hi and !hi
test (1.hi=0) (1.hi+1936.year#1.hi=0) (1.hi+1937.year#1.hi=0)
On Oct 9, 2009, at 2:33 AM, Lloyd wrote:
Hello. I am using -ttest- in combination with -bys- to do group
mean comparison tests by the variable YEAR. Specifically, the
command is...
bys YEAR: ttest REV if inlist(TYPE,1,3), by(TYPE)
My issue is this:
It does the test three separate times, i.e., for each value of
YEAR. That is perfect. But, aside from generating three separate t-
tests for the difference-in-means, is there a way for me to evaluate
the three tests jointly, with a single test statistic? In other
words, let's say that for 2 of the 3 years, I can reject the null.
But, I cannot reject the null for the 3rd year. Can I test the
joint hypothesis that I can reject the null across the 3 years?
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming
| http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* 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/