Hello Statalist Community,
I am working on a dataset covering the period from 2017 to 2019. My dataset includes various variables, each representing different aspects of my research. I am looking to compare the means of these variables using t-tests, but with a specific condition: the means should be calculated and compared within the same year.
To clarify, I want to compare the mean of variable1 in 2017 with the mean of variable2 in 2017, and then do the same for 2018 and 2019. Essentially, I am looking to perform a series of t-tests where each test compares the means of two variables within the same year.
I am unsure how to structure this analysis in Stata. Could anyone provide guidance or suggest the appropriate Stata commands to achieve this? Any help or pointers would be greatly appreciated.
Thank you in advance for your assistance.
Best regards
Johanna
I am working on a dataset covering the period from 2017 to 2019. My dataset includes various variables, each representing different aspects of my research. I am looking to compare the means of these variables using t-tests, but with a specific condition: the means should be calculated and compared within the same year.
To clarify, I want to compare the mean of variable1 in 2017 with the mean of variable2 in 2017, and then do the same for 2018 and 2019. Essentially, I am looking to perform a series of t-tests where each test compares the means of two variables within the same year.
I am unsure how to structure this analysis in Stata. Could anyone provide guidance or suggest the appropriate Stata commands to achieve this? Any help or pointers would be greatly appreciated.
Thank you in advance for your assistance.
Best regards
Johanna
Code:
ttest dacc_noturnover == dacc_ceoturnover, unpaired
Comment