%Stat 351 Lecture 10 %Normal probability plot X =[-0.4326 -1.6656 0.1253 0.2877 -1.1465 1.1909 1.1892 -0.0376 0.3273 0.1746] cdfplot(X) hold on plot([-2:0.1:2],normcdf([-2:0.1:2]),'r-') >>H = lillietest(X,0.05) H = 0 %can't reject H_0 reject H_0 if H =1 >>orderedX = sort(X) >>empirical = [1:10]'/10 empirical = 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 >>quantile = norminv(empirical,0,1) quantile = -1.2816 -0.8416 -0.5244 -0.2533 0 0.2533 0.5244 0.8416 1.2816 Inf %can't plot infinity >>empirical = [1:10]'/11 >>quantile = norminv(empirical,0,1); >>[quantile orderedX] ans = -1.3352 -1.6656 -0.9085 -1.1465 -0.6046 -0.4326 -0.3488 -0.0376 -0.1142 0.1253 0.1142 0.1746 0.3488 0.2877 0.6046 0.3273 0.9085 1.1892 1.3352 1.1909 >>plot(quantile,orderedX,'.') >>hold on >>plot(-2,-2,2,2) >>A= chi2rnd(1,10000,1); >>qqplot(A) >>B=unifrnd(-10,10,10000,1) >>qqplot(A,B)