FAQ: Hypothesis Testing: Associations - Tukey's Range Test

This community-built FAQ covers the “Tukey’s Range Test” exercise from the lesson “Hypothesis Testing: Associations”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Master Statistics with Python

FAQs on the exercise Tukey’s Range Test

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Maybe others were curious about the context of the function and where to put the data and where to put the dependent variables, and alpha. The syntax of the function was not explained well where the data frames needed to go. As the previous t-tests Store A and B could be in any order to be run not the case with how this function needs its input and the data is structured.

How to use the tukey function is as follows:
pairwise_turkey(df.data, df.groups, alpha)

df.data = ndarray with data to be compared in this example it was the column of sales from the different stores.
df.groups = The groups associated with the data in this case it was the column of stores A, B, and C.
alpha= significance level 0.05

tukey_results = pairwise_tukeyhsd(veryants.Sale, veryants.Store, 0.05) print(tukey_results)

Documentation info can be found here:
https://www.statsmodels.org/0.8.0/generated/statsmodels.stats.multicomp.pairwise_tukeyhsd.html

1 Like

Why was the test between b and c not significant in the Tukey exercise but in the t-tests we created it was? I thought Tukey is also running a t-test.

So would it be safe to say that the first input variable should be the array with the quantitative variables in it, and the second one should be the array with the categorical variables in it?

1 Like