Stata Help

Run a Dependent Means T-test in Stata

A dependent means t-test compares the same group of people on a single dimension. It tests against the null hypothesis that there is no difference between the two scores. The independent variable is whatever makes the two scores different (for example, time or temperature of the testing space). The dependent variable is their score on the measure.

To perform a dependent means t-test you will need to have the two scores in two separate columns that are both numeric in type. 

Then simply type ttest [name of variable 1]==[name of variable 2] into the Command window. The double equals sign is important and the command will not function properly without it.

For example, in another made-up sample of college students, I might want to test how the average amount of sleep per night at the beginning of a semester (time1) differed from the average amount of sleep per night at the middle of the semester (time2). This would look like: ttest time1==time2 . Basically, you are asking Stata to test if time1 is equal to time2 via a t-statistic.

The output for this is as follows:

Back