Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for competing risks simulation #106

Open
1 of 6 tasks
adibender opened this issue Apr 27, 2019 · 5 comments
Open
1 of 6 tasks

Support for competing risks simulation #106

adibender opened this issue Apr 27, 2019 · 5 comments

Comments

@adibender
Copy link
Owner

adibender commented Apr 27, 2019

see #105

@pkopper
Copy link
Collaborator

pkopper commented Jun 5, 2019

We should discuss how the existing simulation may be adapted to facilitate the new functions.

@fabian-s
Copy link
Collaborator

fabian-s commented Jun 5, 2019

@adibender : if I read this correctly you'd suggest a new function sim_pexp_cr that deals with CR complications and that gets called from sim_pexp, which is then simply a wrapper for calling either the new sim_pexp_cr or the "old" sim_pexp (renamed as sim_pexp_single, or similar, see below), depending on the formula structure?

OT: probably need to agree on a global naming scheme rule to differentiate CR functionality from "classic" functionality? suggestion: call one "_cr" and the other "_1r" (one risk)?

@fabian-s
Copy link
Collaborator

fabian-s commented Jun 5, 2019

.. and internallly, sim_pexp_cr will probably just a wrapper around calling (parts of) sim_pexp_single for each of the competing risk processes and then using the minimum of the generated event times as the actualized risk/event type, correct?

@adibender
Copy link
Owner Author

adibender commented Jun 5, 2019

Right, I think it would be best to refactor the existing sim_pexp such that

  1. there is a function that constructs the linear predictor given specification of the RHS of the input formula (and data)
  2. within sim_pexp we calculate one linear predictor/hazard for each part of the RHS of the input formula, i.e. for ~ 0.2 * x1 | 0.1 * x2 we calculate two linear predictors (that requieres to fix rewrite code that depends on Formula in preparation for CR formulas #88 first)
    That could be done by looping through the number of RHS arguments and calling the function from 1.
  3. If the List returned in 2. is longer than one, call sim_pexp_cr, otherwise call sim_pexp_1r
    Within sim_pexp_cr it proceeds similar to what I already implemented in the competing-risks branch, but could probably be improved upon.

@adibender adibender removed their assignment Jun 5, 2019
@pkopper
Copy link
Collaborator

pkopper commented Jun 6, 2019

Thank you. I think we are on the same page w.r.t. this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants