generateData: Generate simulated data

View source: R/generateData.R

generateDataR Documentation

Generate simulated data

Description

generateData generates a set of simulated clinical trials' data

Usage

generateData(
  modelparam,
  respparam,
  blparam,
  trialdesign,
  empirical,
  makePositiveDefinite,
  seed = NA
)

Arguments

modelparam

a datatable with a single entry per named column:

  • N Number of simulated participants

  • c.bm Correlation between the biomarker and the biologic response

  • carryover_t1half Halflife of the carryover effect

  • c.tv Autocorrelation for the tv factor across timepoints

  • c.pb Autocorrelation for the pb factor across timepoints

  • c.br Autocorrelation for the br factor across timepoints

  • c.cf1t Correlation between different factors at a single timepoint

  • c.cfct Correlation between different factors at different timepoints

respparam

Data table with 5 columns and 3 rows. The first row lists the 3 factors defining the response trajectories (tv, pb, and br). The rest of the columns are the input parameters for the modgompertz function:

  • max Maximum response value

  • disp Displacement

  • rate Rate

  • sd Standard deviation

blparam

Data table with 3 colums and 3 rows. First row lists the varaibles being defined, which consist of BL for the baseline value of the outcome measure, and bm for the biomarker values. Remaining columns:

  • m Mean

  • sd Standard deviation

trialdesign

The information defining a single path through the clinical trial design, as defined by the output$trialpaths output of buildtrialdesign

empirical

Should the correlations be empirical? (Usually FALSE unless you're doing something odd for testing purposes)

makePositiveDefinite

Should the covariance matrix be forced to be positive definite? (Usually yes, although you may want to turn this off at times to test the impact of this step on your covariance sturcture)

seed

Randomization seed (defaults to NA)

Details

This is the core data simulation code. See vignettes for additional details. This function is primarily called by generateSimulatedResults.

Value

A dat file that contains both the total symptom scores at each timepoint and also all the individual factors that were used to generate those total scores

Examples

  #See vignettes for examples of how to use this

rchendrickson/pmsimstats documentation built on Nov. 28, 2024, 11:05 a.m.