Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cyrilobolonsky/e73dd6b82bdde5a834e3 to your computer and use it in GitHub Desktop.
Save cyrilobolonsky/e73dd6b82bdde5a834e3 to your computer and use it in GitHub Desktop.
A #glfintech R turorial on statistics discussing hypothesis tests - parametric tests (z-test, t-test and ANOVA) and non-parametric tests (Mann-Whitney Test, Wilcoxon Rank-sum test, Wilcoxon Signed-rank Test, Kruskal Wallis Test).
#Shapiro test shows whether the variables have a normal distribution
shapiro.test(lifeexpf)
shapiro.test(lifeexpm)
shapiro.test(birth_rt)
shapiro.test(death_rt)
shapiro.test(world[,2])
shapiro.test(world[,3])
shapiro.test(world[,5])
#We are alomst 100% sure that NONE of the variables follows a normal distribution.
#Chi-squared test shows whether two variables are independent
chisq.test(region,death_rt)
#We are 99,96% sure that Ho is wrong and that the two variables are NOT independent. Hence, the death rate depends upon the region.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment