Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: difference in means for conditional decile grouping
From
Michael Crain <[email protected]>
To
[email protected]
Subject
st: difference in means for conditional decile grouping
Date
Fri, 15 Mar 2013 13:34:47 -0700 (PDT)
I am trying to test the difference in means (t-test) with a bit
of a complex design and cannot figure how to do this.
I have split my sample observations into two subsamples based on
two conditions, Condition A and Condition B. These are
independent samples (not paired). For each of the two subsamples,
I assign the observations to decile groups. My code to create
the deciles is:
-xtile condAdecile = var1 if conditionvar > 0, nq(10)- // create Condition A deciles
-xtile condBdecile = var1 if conditionvar <= 0, nq(10)- // create Condition B deciles
After forming deciles, I can determine the mean decile returns in
each condition with -table-. Below is an example of the
conditional mean decile returns.
Decile Condition A Condition B
------ ----------- -----------
1 10 12
2 13 17
3 18 21
4 24 30
5 28 31
6 30 34
7 34 38
8 39 45
9 44 54
10 49 60
What I want to do is test whether the difference between Deciles
1 and 10 (10-1) differs between the two conditions. Put
differently, 10-1 in Conditions A and B are 39 and 48,
respectively. I want to test whether these two values are
different.
The closest I could come to accomplishing this is keep only the
observations in deciles 1 and 10 (dropping observations in
deciles 2 through 9) and then creating a dummy variable for these
2 deciles. Then I run a standard t-test (independent samples) on
10-1 in each condition.
-bys conditionABdummy: ttest var1, by(decile10_1dummy)-
The output gives me the confidence interval of 10-1 in each
condition. I can observe the confidence intervals in both
conditions for any overlap. However, I want to do a formal t-test
between 10-1 in both conditions: H0: 48-38 = 0
Any advice? I am using Stata 12.
*
* 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/