Hi all,
How can i run a test between 2 different groups within the sample?
More specifically, i ran a regression on men and women - and now i want to see if the estimates are different from each other.
I am using the following code to run the regressions i need.
In total there are 10 regressions, (5 for men and 5 for women)
My goal is to to compare the estimates for each outcome variable.
For example: Outcome = d1lifesat --> test if estimates are different between female==0 and female ==1
The same for the 4 other outcomes (d21lifesat, d32lifesat, d2lifesat, d3lifesat)
What is the easiest way to do so?
Note: What i saw so far in stata is this...
How can i apply this method or is there a different (better?) method?
Thank you very much in advance
How can i run a test between 2 different groups within the sample?
More specifically, i ran a regression on men and women - and now i want to see if the estimates are different from each other.
I am using the following code to run the regressions i need.
In total there are 10 regressions, (5 for men and 5 for women)
Code:
foreach x in 0 1 {
preserve
keep if female==`x'
foreach d in 1 21 32 2 3 {
reg d`d'lifesat treat $xvarsls $exact [weight=w_treat_xvarsls], robust
outreg2 using analysis_ls, append excel dec(4)
est store m`x'_1
qui count if treat==1 & e(sample)
estadd scalar obs =r(N)
}
restore
}
For example: Outcome = d1lifesat --> test if estimates are different between female==0 and female ==1
The same for the 4 other outcomes (d21lifesat, d32lifesat, d2lifesat, d3lifesat)
What is the easiest way to do so?
Note: What i saw so far in stata is this...
Code:
Immediate form of two-sample t test
ttesti #obs1 #mean1 #sd1 #obs2 #mean2 #sd2 [, options2]
Thank you very much in advance

Comment