Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## myres - my previously generated standardized residuals
- ## Generating standard normal quantiles of the middle of the intervals
- ## (k/n, (k+1)/n)
- myquant<-qnorm((1:100-0.5)/100)
- ######### plotting Q-Q plot for comparsion with normal distribution
- plot(myquant,myres)
- abline(0,1)
- ## Critical values for Kolmogorov-Smirnov test for N>50, alpha=0.05 are
- ## 1.36/sqrt(N)
- ## We have F(x) = k/n
- for (i in 1:100)
- {
- ##segments(x0,y0,x1,y1,..)
- points(myquant[i],qnorm(i/100-1.36/sqrt(100)),pch='.')
- points(myquant[i],qnorm(i/100+1.36/sqrt(100)),pch='.')
- }
- ## How it should look like
- library(car)
- qqPlot(rstandard(myl))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement