Session Ready
Exercise

Exploration of composite endpoints

We could also be interested in seeing whether patients visited either a complementary therapist, GP or specialist. Here we will generate a binary composite endpoint for this from the three variables in the Acupuncture dataset. The Acupuncture dataset has been preloaded for this session.

Instructions
100 XP
  • Dichotomize total.therap.visits and encode it as a factor. any.therap.visits should take the value "Did not visit CT" whenever total.therap.visits equals 0 or "Visited CT" otherwise.
  • Generate a combined binary endpoint for the event of having at least one visit to any professional. combined should take the value "No visits" whenever any.therap.visits equals "Did not visit CT" and any.gp.visits equals "Did not visit GP" and any.spec.visits equals "Did not visit specialist", or "At least one visit" otherwise.
  • Dichotomize total.therap.visits into 0 or at least 1 visit, encode it as a factor, and assign it to a column named any.therap.visits.
  • The above has been done for you to generate any.gp.visits and any.spec.visits. Use these variables to generate a combined binary endpoint for the event of having at least one visit to any professional.
  • Tabulate the binary endpoint.