T Test

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/3

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

4 Terms

1
New cards
Import key packages

import pandas as pd

from scipy.stats import ttest_ind

2
New cards
Comparing the two months

month_1='January'

month_2=’February’

sales_month_1=df[df[‘Month’]==month_1][‘Sales’]

sales_month_2=df[df[‘Month’]==month_2][‘Sales’]

3
New cards
Ttest_ind example
t_stat, p_value=ttest_ind(sales_month_1, sales_month_2, equal_var=False)
4
New cards
Print results of the t-test

print(f"T-statistic: {t_stat}, p-value: {p_value}")

if p_value<0.05:

print(“There is a significant difference in sales between the two months.”)

else:

print(“There is no significant difference in sales between the two months.”)