Hello,
I am using Stata 17/BE for Mac and I am struggling to create a specific table that contains means, mean diffrences and ttests results.
For different school level, I am comparing grade means between two groups for each subject. The dummy variable a5 determines the group the subjects are in. The string variable “cours” contains three school subjects : math, fran and ang.
I can do the first part with (example):
tabulate course a5 if level==40, summarize(grade)
I know how to test means using (example):
ttest grade if level==40 & course=="math", by(a5)
But I can’t figure out how to put what I want in just one table… Here is the kind of table I would like to have for each level:
Could someone help me please?
Thank you very much,
I am using Stata 17/BE for Mac and I am struggling to create a specific table that contains means, mean diffrences and ttests results.
For different school level, I am comparing grade means between two groups for each subject. The dummy variable a5 determines the group the subjects are in. The string variable “cours” contains three school subjects : math, fran and ang.
I can do the first part with (example):
tabulate course a5 if level==40, summarize(grade)
I know how to test means using (example):
ttest grade if level==40 & course=="math", by(a5)
But I can’t figure out how to put what I want in just one table… Here is the kind of table I would like to have for each level:
course | a5=0 | a5=1 | DIFFERENCE | Ttest result (Pr(|T| > |t|) |
math | Mean(0) (std. dev.) |
Mean(1) (std. dev.) |
Mean(0) – mean(1) | ex: 0,50 |
fran | Mean(0) (std. dev.) |
Mean(1) (std. dev.) |
Mean(0) – mean(1) | ex: 0,005*** |
ang | Mean(0) (std. dev.) |
Mean(1) (std. dev.) |
Mean(0) – mean(1) | ex: 0,09* |
Thank you very much,
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id str4 course int level byte grade float a5 8206906 "math" 60 52 1 8206989 "ang" 40 66 1 8206989 "ang" 60 37 1 8206989 "fran" 40 76 1 8206989 "fran" 60 51 1 8206989 "math" 40 70 1 8206989 "math" 60 48 1 8212722 "ang" 40 49 0 8212722 "ang" 60 57 0 8212722 "fran" 40 65 0 8212722 "fran" 60 73 0 8212722 "math" 40 46 0 8212722 "math" 60 55 0 8213951 "ang" 40 66 1 8213951 "ang" 60 74 1 8213951 "fran" 40 46 1 8213951 "fran" 60 70 1 8213951 "math" 40 46 1 8213951 "math" 60 62 1 8215246 "ang" 40 71 1 8215246 "ang" 60 67 1 end
Comment