0001
0002
0003
0004
0005
0006
0007 load morths;
0008 fit = locfit(age,deaths,'weights',n,'family','binomial','alpha',0.5);
0009
0010 figure('Name','fig4_3a: Residual plots for local likelihood');
0011 plot(age,residuals(fit,'dev'),'.-');
0012 xlabel('Age');
0013 ylabel('Residual');
0014 title('Deviance Residuals');
0015 hold on;
0016 plot([min(age) max(age)],[0 0],':');
0017 hold off;
0018
0019 figure('Name','fig4_3b: Residual plots for local likelihood');
0020 plot(age,residuals(fit,'pear'),'.-');
0021 xlabel('Age');
0022 ylabel('Residual');
0023 title('Pearson Residuals');
0024 hold on;
0025 plot([min(age) max(age)],[0 0],':');
0026 hold off;
0027
0028 figure('Name','fig4_3c: Residual plots for local likelihood');
0029
0030 plot(age,residuals(fit,'raw'),'.-');
0031 xlabel('Age');
0032 ylabel('Residual');
0033 title('Raw (response) Residuals');
0034 hold on;
0035 plot([min(age) max(age)],[0 0],':');
0036 hold off;
0037
0038 figure('Name','fig4_3d: Residual plots for local likelihood');
0039 plot(age,residuals(fit,'ldot'),'.-');
0040 xlabel('Age');
0041 ylabel('Residual');
0042 title('ldot Residuals');
0043 hold on;
0044 plot([min(age) max(age)],[0 0],':');
0045 hold off;
0046