Open in the MATLAB editor: g08ck_example
function g08ck_example fprintf('g08ck example results\n\n'); y = [0.3131132, 0.2520412, 1.5788841, 1.4416712,-0.8246043,-1.6466685, ... 0.7943184, 1.2874915,-0.8347250, 0.3352505, 0.9434467, 2.1099520, ... -0.2801654,-0.7843009, 0.6218187, 2.0963809, 1.7170403,-0.1350142, ... 0.7982763,-0.2980977, 1.2283043, 1.5576090,-0.4828757, 2.6070754, ... 0.1213996, 0.1431621]; % Let g08ck sort the data issort = false; % Calculate a-squared and probability [ybar, yvar, a2, aa2, p, ifail] = ... g08ck(issort, y); % Results fprintf('H0: data from normal distribution\n'); fprintf(' with mean %8.4f\n', ybar); fprintf(' and variance %8.4f\n', yvar); fprintf('Test statistic, A-squared: %8.4f\n', a2); fprintf('Adjusted A-squared: %8.4f\n', aa2); fprintf('Upper tail probability: %8.4f\n', p);
g08ck example results H0: data from normal distribution with mean 0.5639 and variance 1.1386 Test statistic, A-squared: 0.1660 Adjusted A-squared: 0.1713 Upper tail probability: 0.9312