fig7_3.m 492 B

12345678910111213141516171819
  1. % Local Regression and Likelihood, Figure 7.3.
  2. %
  3. % Censored local regression.
  4. %
  5. % Author: Catherine Loader
  6. %
  7. % NEEDS: Kaplan-Meier based estimate. Identify curves and cens/uncens. data
  8. load heart;
  9. fit = locfit(age,log(0.5+surv));
  10. figure('Name','fig7_3: censored local regression Kaplan-Meier based;' );
  11. lfplot(fit);
  12. xlabel('Age at Transplant (years)');
  13. ylabel('0.5+Survival Time (Days)');
  14. fit = lf_censor(age,log(0.5+surv),cens);
  15. hold on;
  16. lfplot(fit,'nodata');
  17. hold off;