%ppqq.m
close all force
%
s = RandStream('mt19937ar','Seed',0);
RandStream.setGlobalStream(s);
n=100
y=trnd(7,[n,1]);
%--------------------------
ys=sort(y);
xs=normcdf(ys, mean(y), std(y));
figure(1)
plot( xs, (1:n)/n, 'o-')  %PP-Plot
xlabel('$F(y_{(i)})$','interpreter','latex')  
ylabel('$i/n$','interpreter','latex') 
print -depsc 'C:\STAT\Goodness\Goodnesseps\PPQQ2a.eps' 
 
figure(2)
plot(ys, norminv( (0.5:1:n)./n),'o-') %QQ-Plot
xlabel('$y_{(i)}$','interpreter','latex') 
ylabel('$F^{-1}((i-1/2)/n)$','interpreter','latex','fontsize',16) 
axis tight
print -depsc 'C:\STAT\Goodness\Goodnesseps\PPQQ2b.eps' 