0
0
Data Analysis Pythondata~5 mins

t-test with scipy.stats in Data Analysis Python - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a t-test used for in data analysis?
A t-test helps us compare the average values of two groups to see if they are different in a meaningful way.
Click to reveal answer
beginner
Which function in scipy.stats is commonly used to perform a t-test for independent samples?
The function scipy.stats.ttest_ind() is used to compare the means of two independent groups.
Click to reveal answer
beginner
What does the p-value from a t-test tell us?
The p-value shows the chance that the difference between groups happened by random chance. A small p-value (like less than 0.05) means the difference is likely real.
Click to reveal answer
intermediate
How do you perform a paired t-test using scipy.stats?
Use scipy.stats.ttest_rel() to compare two related samples, like measurements before and after a treatment on the same subjects.
Click to reveal answer
intermediate
What assumptions must be met to correctly use a t-test?
The data should be roughly normally distributed, the samples should be independent (except for paired tests), and variances should be similar for independent t-tests.
Click to reveal answer
Which scipy.stats function is used for an independent two-sample t-test?
Attest_1samp
Bttest_rel
Canova
Dttest_ind
What does a p-value less than 0.05 usually mean in a t-test?
AThere is strong evidence the groups differ
BThe groups are definitely the same
CThe test was done incorrectly
DThe sample size is too small
Which t-test should you use to compare measurements before and after treatment on the same people?
Attest_ind
Bttest_rel
Cttest_1samp
Dchi-square test
Which assumption is NOT required for a t-test?
AData is normally distributed
BSamples are independent (for independent t-test)
CData is categorical
DVariances are similar between groups
What does scipy.stats.ttest_1samp() do?
ATests if a sample mean differs from a known value
BCompares two related groups
CCompares two independent groups
DTests for correlation between variables
Explain how to perform an independent t-test using scipy.stats and interpret the results.
Think about comparing two groups like test scores from two classes.
You got /4 concepts.
    Describe the main assumptions behind using a t-test and why they matter.
    Consider what could go wrong if data is very skewed or samples are related but treated as independent.
    You got /4 concepts.