0001
0002
0003
0004
0005
0006
0007 load morths;
0008 fit = locfit(age,deaths,'weights',n,'family','binomial','alpha',0.5);
0009
0010 figure(1);
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(2);
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(3);
0029 plot(age,residuals(fit,'raw'),'.-');
0030 xlabel('Age');
0031 ylabel('Residual');
0032 title('Raw (response) Residuals');
0033 hold on;
0034 plot([min(age) max(age)],[0 0],':');
0035 hold off;
0036
0037 figure(4);
0038 plot(age,residuals(fit,'ldot'),'.-');
0039 xlabel('Age');
0040 ylabel('Residual');
0041 title('ldot Residuals');
0042 hold on;
0043 plot([min(age) max(age)],[0 0],':');
0044 hold off;
0045