Book Image

Data Analysis with STATA

Book Image

Data Analysis with STATA

Overview of this book

Table of Contents (16 chapters)
Data Analysis with Stata
About the Author
About the Reviewers

T tests

Let's start with t tests. A sample t test gives you a leverage point to check whether the sample mean that can have a normally distributed variable has a significant difference from the hypothesis value. For example, you need to test whether the fridge sales average is significantly different from 10000. Here is the command to run the t test:

ttest fridge_sales = 10000

This command checks whether the mean or average of fridge_sales differs significantly from 10000. Here is the exact formula for a sample t test:

Here are the results of One-sample t test as per the command that's run in Stata:

This result shows that there is a statistically significant difference between the mean values of fridge_sales and 10000. Let's see whether you have more than one group to compare the means. In this case, you can use two independent sample t-tests.

Two independent sample t tests

Independent samples' t tests are utilized when we need to compare and check the averages of a variable that is normally...