Created
August 28, 2015 19:24
-
-
Save mick001/ab4076bf4b9803efc1b5 to your computer and use it in GitHub Desktop.
Hypothesis testing on normally distributed data in R (part 2). Full article at: http://www.firsttimeprogrammer.blogspot.com/2015/07/hypothesis-testing-on-normally.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot of the Student distribution | |
dfs <- length(data_vector)-1 | |
x_ <- seq(-8,8,0.1) | |
y <- dt(x_,dfs) | |
t.val <- qt(1-0.05,df=dfs) | |
plot(x_,y,type='l',lwd=3,col='blue',xlab='x',ylab='Density',main='Student distribution 9 dof') | |
abline(v=0) | |
abline(v=t.val,lwd=2,col='red') | |
points(t.val,dt(t.val,dfs),lwd=3,col='red') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment