Skip to content

Instantly share code, notes, and snippets.

@HeenaR17
Created March 23, 2021 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HeenaR17/a9f199da8a54faf143a5e5ee6a7e1c50 to your computer and use it in GitHub Desktop.
Save HeenaR17/a9f199da8a54faf143a5e5ee6a7e1c50 to your computer and use it in GitHub Desktop.
#Paired Ttest
#appending some values using normal distribution
marks=[10,20,30,22,33,44,15,50,46,25,45,25,33,12,45,34,31,30,30,30]
marks2=marks+stats.norm.rvs(scale=5,loc=-1.25,size=20)
ttest,p_value=stats.ttest_rel(a=marks, b=marks2)
if p_value >= 0.5:
print("Accept null hypothesis")
else:
print("Reject null hypothesis")
# Output: Reject null hypothesis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment