Course contents

AppendixAppendices

Methods exercise solutions: where to find them (Chapters 19 to 31)

On this page
  1. Notes for instructors

Every chapter has a Try it section before its checkpoint. The solution to each question sits directly under it, in a collapsed “Show solution” box. Try the question first, then open the box to check your work. Examples use only the supplied fake data.

This page is an index. It lists each chapter’s Try it section and how many questions it holds. The solutions for Chapters 1 to 18 are indexed on the main solutions page.

Notes for instructors

  • Numbers vary. Some numeric results depend on the R and package versions. Ask learners to run the supplied code rather than memorize scores.
  • A higher CV score is not a better clinical method. When a learner reports that one method scored higher in cross-validation, ask what that score can and cannot show about use in a clinic.
  • Chapter 22. A later follow-up end date usually reduces censoring, because more simulated events are observed. A Cox hazard ratio compares instantaneous event rates under the model’s assumptions; it is not a risk ratio.
  • Chapter 30. Governance belongs in the methods plan from the start, next to the population, split and metric, not added after the results.
  • Chapter 31 grading. There is no single numeric answer. The scripts deliberately keep development cross-validation apart from the held-out final evaluation; check that the learner does not pick the best cross-validation method and then keep looking up its final test score while tuning further.