Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ## myres - my previously generated standardized residuals
  2.  
  3. ## Generating standard normal quantiles of the middle of the intervals
  4. ## (k/n, (k+1)/n)
  5.  
  6. myquant<-qnorm((1:100-0.5)/100)
  7.  
  8. ######### plotting Q-Q plot for comparsion with normal distribution
  9.  
  10. plot(myquant,myres)
  11. abline(0,1)
  12.  
  13. ## Critical values for Kolmogorov-Smirnov test for N>50, alpha=0.05 are
  14. ## 1.36/sqrt(N)
  15. ## We have F(x) = k/n
  16.  
  17. for (i in 1:100)
  18. {
  19. ##segments(x0,y0,x1,y1,..)
  20. points(myquant[i],qnorm(i/100-1.36/sqrt(100)),pch='.')
  21. points(myquant[i],qnorm(i/100+1.36/sqrt(100)),pch='.')
  22. }
  23.  
  24. ## How it should look like
  25. library(car)
  26. qqPlot(rstandard(myl))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement