Skip to contents

Generates a data generating function that give p-values from an unpaired t-test of data generated by multivariate normal distribution as specified

Usage

get_data_gen(
  corr_control,
  corr_treatment,
  eff,
  n_cont,
  n_treat,
  binary = integer(0),
  bin_con_resp = NULL,
  bin_treat_resp = NULL
)

Arguments

corr_control

correlation matrix for all the control endpoints

corr_treatment

correlation matrix for all the treatment endpoints

eff

vector of effect sizes (i.e. means) of the different treatment endpoints (compared to the control)

n_cont

number of data points in the control endpoints

n_treat

number of data points in the treatment endpoints

binary

which treatment endpoints are binary endpoints (all control endpoints referenced by those are also automatically treated as binary)

bin_con_resp

response rate of the binary control groups

bin_treat_resp

response rate of the binary treatment groups

Value

A function taking two arguments, see details

Details

This gives back a function, which takes as its arguments a number n and a multiarm_cer_design object and returns a matrix of n * number of treatments p-values. Each of those p-values is generated by drawing as many data points as specified in the design object with the given correlation and mean, and comparing it with a t-test to the data points generated for the controls specified by treatment_assoc of the design object.

Binary endpoints

Binary endpoints have to be specified separately. Using means that eff does not get used anymore for those endpoints, but correlation between the endpoints is still given, since the binary endpoint is calculated from the normal data. Additionally, this currently assumes that the covariance of all binary endpoints (so the diagonal value of the correlations) is 1

The test used for the enpoints is a one-sided two-proportion z-test, where the tested outcome is a higher response rate for the treatment group.