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)
margins after an unconditional melogit modelI'm trying to understand what the margins command does after an unconditional melogit model. Specifi…
Independent variable is not significant when run alone, however when I include it in an index it is significant. How should I proceed?I am writing a research project on the impact of freedom in countries on the handling of COVID-19, w…
Connecting Stata to Snowflake ODBCHello all. I'm looking for some assistance or guidance in setting up a Snowflake ODBC connection for…
How to estimate Hierarchical Linear Models in this case?Dear all, I have a pooled dataset of 16 countries and I want to estimate hierarchical linear models…
GMM: Forward and backward orthogonal deviations (xtabond2)Dear Statalisters, it is the first time I use GMM and xtabond2. Playing around with the syntax, aft…
Subscribe to:
Post Comments (Atom)
0 Response to T-Test with foreach (for 4 Variables)
Post a Comment