Genentech / psborrow2

psborrow2: Bayesian Dynamic Borrowing Simulation Study and Analysis
https://genentech.github.io/psborrow2/
Other
16 stars 2 forks source link

design for data simulation #210

Closed gravesti closed 6 months ago

gravesti commented 1 year ago

Feature description

Functions to simulate data as in psborrow

Code of Conduct

Contribution Guidelines

mattsecrest commented 1 year ago

@gravesti I think this looks great! I have two questions.

  1. I don't see anywhere where we easily add multiple iterations to a given simulation scenario. Am I missing somehting or will the user just do this themselves?
  2. I am not sure about accomodating I(age^2) in the model formula or instead giving the user access to the simulatd data to make their own changes, eg:
baseline_obj <- sim_baseline(
  sample_size = c(trt_int = 100, ctrl_int = 50, ctrl_ext = 200),
  covariates = list(correlated_covs, indep_covs)
) %>% 
  add_vars(age_2 = age*age)
gravesti commented 1 year ago

Good questions @mattsecrest

  1. I am thinking whether the result of sim_baseline() would be a data.frame or an object that can generate a data.frame. Are you thinking about generating N datasets with the same parameters, or with different ones?
  2. I think we can do something like add_vars. I'd already planned transform() for creating eg binary variables. Maybe it's not much different. I'm wary of doing NSE, so let's see how it can be implemented easily.

I'd like at least to get the correlated data simulation set up, then we can build this stuff on top.