stillupdates.blogg.se

T test stata
T test stata




t test stata

If the population mean is 14, then the probability of drawing a sample with a mean that is 13.38 or greater is 0.9982 (i.e. You must pick the alternative hypothesis you're interested in testing before running the test.įirst consider Ha: mean 14. The 95% confidence interval ranges from 12.97 to 13.80, which does not include 14, so it's not looking good for our null hypothesis.įormal evaluation compares the null hypothesis ( Ho), that the mean is 14, with one of three alternative hypotheses ( Ha): that the mean is less than 14, that the mean is not equal to 14 but could be bigger or smaller, and that the mean is greater than 14. But in order to evaluate the hypothesis that mean is really 14, you have to consider the uncertainty about that estimate. The mean of educ in the sample, which is also the best estimate of the population mean, is 13.38. Suppose you want to test the hypothesis that the population mean of educ is 14 years. Hypothesis: The Population Mean is Equal to Some Specified Value If you plan on applying what you learn directly to your homework, create a similar do file but have it load the data set used for your assignment. Then create a do file called ttests.do in that folder that loads the GSS sample as described in Doing Your Work Using Do Files. If you plan to carry out the examples in this article, make sure you've downloaded the GSS sample to your U:\SFS folder as described in Managing Stata Files. We will discuss the interpretation of the t-test in detail for the first type of hypothesis (that the mean is equal to a specified value) but the discussion applies to all the hypotheses a t-test can test. Looking at the results and then picking the alternative hypothesis that matches what you'd like to see will increase the probability of drawing the wrong conclusion from the test. Stata will report results for all three alternative hypotheses, but you should choose which one you're interested in ahead of time. Your alternative hypothesis could then be one of the following: that the mean education level of women is higher than the mean education level of men, that the mean education level of men is higher than the mean education level of women, or that the mean levels of education are different regardless of which is higher. For example, if you're investigating differences between men and women in the mean education level, your null hypothesis will usually be that they are the same. Usually the null hypothesis is the opposite of what you're really interested in. This is called a two-sample t-test, and is the most common.įor all these tests we've described the null hypothesis. The final type of hypothesis we'll consider is whether two groups have the same population mean for a single variable. The Population Means for Two Subsamples are the Same

t test stata

the value of X for observation 1 has a relationship to the value of Y for observation 1 that does not exist between the value of X for observation 1 and the value of Y for observation 2). This is called a paired-sample t-test, because the test assumes that the values of the two variables for the same observation go together (i.e. The Population Means for Two Variables are the SameĪnother type of hypothesis looks at whether two variables have the same population mean. This is called a single-sample t-test, because you look at the entire sample at once. One type of hypothesis simply asks whether the population mean of a variable is equal to some particular value of interest. In this section we'll discuss the following types of tests: The Population Mean is Equal to Some Specified Value The command to run one is simply ttest, but the syntax will depend on the hypothesis you want to test. T-tests are frequently used to test hypotheses about the population mean of a variable.

t test stata

If you are new to Stata we strongly recommend reading all the articles in the Stata Basics section. This article is part of the Stata for Students series.






T test stata