Hypothesis Testing Basics


Hypothesis Testing Basics

Simon
So Michael, we're diving into hypothesis testing today. This is where we use sample data to test whether a population parameter—like the mean or proportion—has actually changed from some assumed value.

Michael
Right, and it's really similar to confidence intervals in that we're working with sample data to make inferences about a population. But instead of estimating a range, we're testing a specific claim.

Simon
Exactly. The process usually follows five steps. The first step is to identify the hypotheses. You have the null hypothesis, which is the assumed value—the status quo—and it always includes an equal sign. Then there's the alternative hypothesis, which represents a change, and it uses an inequality like less than, greater than, or not equal to.

Michael
So the null is what we assume to be true until we have evidence otherwise. And the alternative is what the researcher suspects might be true. That makes sense.

Simon
Yes. And those hypotheses are always about the population parameter, like mu for the mean, p for the proportion, or sigma for standard deviation. The null uses the assumed value, say mu equals some number, and the alternative uses that same number but with an inequality.

Michael
Okay, step one done. What's step two?

Simon
Step two is computing the test statistic. This is a value calculated from the sample data that we'll use to compare against the null. The type of statistic depends on the parameter. For proportions, it's a Z-score. For the mean, if we know the population standard deviation—which is rare—we use a Z-score, but usually we only have the sample standard deviation, so we use a t-score. And for standard deviation or variance, we use a chi-square statistic.

Michael
So the formula for the Z-test for proportions is: sample proportion minus null proportion, divided by the square root of (null proportion times one minus null proportion over sample size). And for the mean t-test it's sample mean minus null mean, divided by sample standard deviation over square root of n.

Simon
Exactly. Those formulas show how far the sample statistic is from the null value in standard error units. Once we have that test statistic, we move to step three: determining the p-value or comparing to a critical value.

Michael
Right. And that involves alpha, the significance level. That's the probability of making a Type I error—rejecting a true null hypothesis. Common alphas are 0.05, 0.01, or 0.10.

Simon
Yes. And there are two ways to make a decision. The critical value method: we find the cutoff value(s) from the distribution that leave an area of alpha in the tail(s). If the test statistic falls beyond that critical value, we reject the null. The p-value method: we compute the probability of getting a test statistic as extreme as ours, assuming the null is true. If that p-value is less than alpha, we reject.

Michael
And the choice of one-tailed or two-tailed depends on the alternative hypothesis. If it's 'less than', it's a left-tailed test. If 'greater than', right-tailed. If 'not equal to', two-tailed, with alpha split evenly between both tails.

Simon
Exactly. Step four is making the decision: either reject the null or fail to reject it. And step five is the conclusion, written in the context of the problem. You say something like 'There is sufficient evidence to reject the claim that...' or 'There is not enough evidence...'

Michael
Let's do an example to solidify this. The transcript had one about Thanksgiving carbs. A survey said 38% of Americans won't eat carbs. A dietitian thinks that percentage is too high—actually lower. So the null is p = 0.38, alternative p < 0.38.

Simon
Right. They sampled 150 people, 48 said they won't eat carbs. That gives a sample proportion p-hat = 48/150 = 0.32. The test statistic Z = (0.32 - 0.38) / sqrt(0.38 * 0.62 / 150). That comes out to about -1.51.

Michael
Now with alpha = 0.05, you can use StatCrunch. For a left-tailed test, the critical Z-value is -1.645. Our test statistic -1.51 is greater than -1.645, so it's not in the rejection region. That means we fail to reject the null.

Simon
And the p-value from StatCrunch was about 0.065, which is greater than 0.05. So same decision. The conclusion: there is not enough evidence to support the dietitian's claim that the proportion is lower than 38%.

Michael
That's a nice example. And for the mean, the process is similar. You'd use a t-test, and StatCrunch has options for one-sample t-test with summary or raw data.

Simon
Yes. And when you move to two populations, it's almost the same logic, but now you're comparing two parameters. For example, testing whether the means of two groups are equal. You set up the null as the difference being zero, and the alternative can be less than, greater than, or not equal to zero.

Michael
And StatCrunch handles that easily too. Under Stat, you pick Two Sample, then the appropriate test. So the whole framework is consistent across different parameters and number of samples.

Simon
Exactly. The key is to follow the five steps: hypotheses, test statistic, decision rule (critical value or p-value), decision, and conclusion. And always write the conclusion in plain language that answers the research question.

Ask anything
We've read this whole study set, so questions about it get the best answers.