How can you determine if you are using a two tailed test vs a one tailed test? For example, for the below, which test would I use?

Based on this data, at α =.01, can we conclude that the proportion of democrats who favor “junk food" tax is more than 5% higher than proportion of republicans who favor such a tax?

For one-tailed test, you are only looking for deviation in one direction, indicated by your alternative hypothesis.

Ho: a = b
Ha: a > b or a < b

For a two-tailed test, you are just looking for any difference.

Ho: a = b
Ha: a ≠ b

I hope this helps.

To determine whether to use a two-tailed test or a one-tailed test, you need to consider the hypothesis you want to test and the directionality of the effect you expect.

In this case, the hypothesis is that the proportion of Democrats who favor a "junk food" tax is more than 5% higher than the proportion of Republicans who favor such a tax. The key here is the phrase "more than," which implies a one-sided or one-tailed hypothesis test.

If you were considering a two-tailed test, you would not specify a direction of effect. Instead, you would test whether the proportions are significantly different from each other, without favoring one direction over the other (i.e., higher or lower).

In this specific example, since the hypothesis is concerned with whether the proportion of Democrats who favor the tax is higher than the proportion of Republicans, you would use a one-tailed test.

To conduct the test, you would calculate the difference between the two proportions and test whether this difference is significantly greater than zero.