Created
March 20, 2019 03:15
-
-
Save nashutoing/344ca32995d3c71ce72fea32df3a34c7 to your computer and use it in GitHub Desktop.
Q-Qplot for rnorm(100) and normal distribution
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
rn<- rnorm(100) #make 100 random numbers followed by N(0,1) | |
rns<- sort(rn) #sort or order by ascending order(essential?) | |
plot(rns) #No useful(x-axis is represented as index) | |
rnss<- ecdf(rns) #ready for making cumlative function | |
par(mfrow=c(1,3)) #divide to set 3 graphs | |
plot(rnss) #cumlative function for rnorm(100) | |
abline(h=0.4) #draw horizon=0.4 line | |
curve(pnorm(x,0,1),xlim=c(-3,3)) | |
abline(h=0.4) #pnorm=cumlative function for normal distribution | |
qqnorm(rn,qtype="Type9") #make qqplot | |
abline(h=-0.24) #draw h=-0.24 line | |
abline(v=-0.25) #draw h=-0.25 line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment