/* ** DrawQQ ** ** Purpose: ** Show how a qq plot could be constructed ** ** Date: ** 20/8/09 ** ** Author: ** Charles Bos */ #include #include // #include main() { decl vY, vQE, vQN, iN, dS, vQ; iN= 1000; dS= 4; vY= dS*rann(1, iN); DrawQQ(0, vY, "Norm s=4", QQ_N, dS, 0); vQ= range(.01, .99, .01); vQE= quantiler(vY, vQ); vQN= dS*quann(vQ); print (vQ|vQE|vQN); // Plot theoretical against empirical probabilities DrawTitle(1, "PP-plot"); DrawXMatrix(1, probn(vQE/dS), "Theor", vQ, "Emp", 0, 2); // Plot empirical against theoretical quantiles DrawTitle(2, "QQ-plot"); DrawXMatrix(2, vQN, "Theor", vQE, "Emp", 0, 2); ShowDrawWindow(); }