fig1_2.m 535 B

1234567891011121314151617181920212223
  1. % Local Regression and Likelihood, Figure 1.2.
  2. %
  3. % Spencer's mortality data, 15- and 21-point rules.
  4. % Doesn't use locfit!
  5. load spencer;
  6. figure('Name','fig1_2a: Spencer mortality data');
  7. plot(age,mortality,'o');
  8. title('15-point rule');
  9. xlabel('Age (Years)');
  10. ylabel('Mortality Rate');
  11. hold on;
  12. plot(age,spence15(mortality));
  13. hold off;
  14. figure('Name','fig1_2b: Spencer mortality data');
  15. plot(age,mortality,'o');
  16. xlabel('Age (Years)');
  17. ylabel('Mortality Rate');
  18. title('21-point rule');
  19. hold on;
  20. plot(age,spence21(mortality));
  21. hold off;