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

Allow tidy-Samples to return fitted probabilities of toxicity #749

Open
Puzzled-Face opened this issue Nov 24, 2023 · 0 comments
Open

Allow tidy-Samples to return fitted probabilities of toxicity #749

Puzzled-Face opened this issue Nov 24, 2023 · 0 comments
Labels
enhancement New feature or request low priority

Comments

@Puzzled-Face
Copy link
Collaborator

The tidy method converts an object created by crmPack methods to a (list of) tibble(s). In the case of a Samples object, the list consists of two elements, data and options. The data element looks like this:

d <- .DefaultData()
m <- .DefaultLogisticLogNormal()
o <- .DefaultMcmcOptions()

samples <- mcmc(d, m, o)

(samples |> tidy())$data
# A tibble: 1,000 × 10
   Iteration Chain alpha0 alpha1 nChains nParameters nIterations nBurnin nThin parallel
       <int> <int>  <dbl>  <dbl>   <int>       <int>       <int>   <int> <int> <lgl>   
 1         1     1 -0.238  3.15        1           1        2250     250     2 FALSE   
 2         2     1 -0.704  0.941       1           1        2250     250     2 FALSE   
 3         3     1 -0.473  0.793       1           1        2250     250     2 FALSE   
 4         4     1 -0.286  3.17        1           1        2250     250     2 FALSE   
 5         5     1 -0.188  1.76        1           1        2250     250     2 FALSE   
 6         6     1 -0.188  1.76        1           1        2250     250     2 FALSE   
 7         7     1 -0.455  4.74        1           1        2250     250     2 FALSE   
 8         8     1 -0.455  4.74        1           1        2250     250     2 FALSE   
 9         9     1 -0.884  1.25        1           1        2250     250     2 FALSE   
10        10     1 -1.48   7.57        1           1        2250     250     2 FALSE   
# ℹ 990 more rows

It would be convenient if the returned tibble contained the estimated probability of toxicity for each dose as well as the sampled model parameters.

This could be easily achieved by adding model and doseGrid (or data) parameters to tidy methods for ModelTox objects. The tidy method would then expand the basic tidied tibble for the Samples object with the requested doses and then apply the Model's probFunction to obtain the requested probabilities of toxicity.

Additionally, a probs option could be added to the tidy method to obtain the posterior distribution of the dose with a given probability of toxicity using similar methodology.

Use of both probs and doseGrid (or model) in the same call would not be permitted.

Options for dual endpoint models need further consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
Status: Triage
Development

No branches or pull requests

1 participant