Hey listers, I want to do a t-test for 4 variables (buy1,sell1, buy2, sell2) (they all match certain conditions hence I gave them the value 1 if they do) (for each t-test only comparing 2 of them). So I generated 2 groups
gen group = 1 if buy1 == 1
replace group = 2 if sell1 == 1
ttest var, by(group)
But how do I do compare everytime 2 of the 4 groups? tried it with command foreach, but I am not sure how to do that. (I want to do that for a few more variables.)
I hope there is a solution.
Related Posts with T-Test with foreach (for 4 Variables)
plotting the OR & CIHi all, I am a 4th-year psychology student doing my Honours thesis and my supervisor has suggested …
Risk Ratios from Survival DataHi all, Does anyone have any experience calculating risk ratios from survival data generated sts li…
ppmlhdfe error when no independent variable is includedDear STATA community, I run into error when I run ppmlhdfe with no independent variable. For exampl…
Estimating Risk Ratios from Survival DataHi all, Does anyone have any experience calculating risk ratios from survival data generated sts li…
Indicator for top 1% and bottom 1%I have a dataset on commuting zones (labour markets) and US adoption of robot capital. My dataset lo…
Subscribe to:
Post Comments (Atom)
0 Response to T-Test with foreach (for 4 Variables)
Post a Comment