Dear all,
I have a panel data set of individuals across multiple year. I want run a simple t-test and then plot the means of the two groups on a graph.
In particular, I wan to compare hourly wages of women comparing two groups (moms and women without kids), but across age quantiles. If I repeat t-tests for each quantile, the code would look like:
Where _sex indicate females, parent is a dichotomous variable equal to 1 if a female in the sample has kids and agequant is a variable that divides ages in 10 quantiles.
1 Is there a practical way to do this bunch of codes in one line?
2 How can I plot the means of each group to be tested in a two-way line?
Thank You in advance
Best
Stefano
I have a panel data set of individuals across multiple year. I want run a simple t-test and then plot the means of the two groups on a graph.
In particular, I wan to compare hourly wages of women comparing two groups (moms and women without kids), but across age quantiles. If I repeat t-tests for each quantile, the code would look like:
Code:
ttest hpay if _sex == 2 & agequant == 1, by(parent) ttest hpay if _sex == 2 & agequant == 2, by(parent) ttest hpay if _sex == 2 & agequant == 3, by(parent) ttest hpay if _sex == 2 & agequant == 4, by(parent)
1 Is there a practical way to do this bunch of codes in one line?
2 How can I plot the means of each group to be tested in a two-way line?
Thank You in advance
Best
Stefano
Comment