Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

fig4_3.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. % Local Regression and Likelihood, Figure 4.3.
  2. % Author: Catherine Loader
  3. %
  4. % Residual plots for local likelihood.
  5. % Henderson-Shepherd Mortality Data.
  6. load morths;
  7. fit = locfit(age,deaths,'weights',n,'family','binomial','alpha',0.5);
  8. figure('Name','fig4_3a: Residual plots for local likelihood');
  9. plot(age,residuals(fit,'dev'),'.-');
  10. xlabel('Age');
  11. ylabel('Residual');
  12. title('Deviance Residuals');
  13. hold on;
  14. plot([min(age) max(age)],[0 0],':');
  15. hold off;
  16. figure('Name','fig4_3b: Residual plots for local likelihood');
  17. plot(age,residuals(fit,'pear'),'.-');
  18. xlabel('Age');
  19. ylabel('Residual');
  20. title('Pearson Residuals');
  21. hold on;
  22. plot([min(age) max(age)],[0 0],':');
  23. hold off;
  24. figure('Name','fig4_3c: Residual plots for local likelihood');
  25. plot(age,residuals(fit,'raw'),'.-');
  26. xlabel('Age');
  27. ylabel('Residual');
  28. title('Raw (response) Residuals');
  29. hold on;
  30. plot([min(age) max(age)],[0 0],':');
  31. hold off;
  32. figure('Name','fig4_3d: Residual plots for local likelihood');
  33. plot(age,residuals(fit,'ldot'),'.-');
  34. xlabel('Age');
  35. ylabel('Residual');
  36. title('ldot Residuals');
  37. hold on;
  38. plot([min(age) max(age)],[0 0],':');
  39. hold off;