Description Usage Arguments Details Value Examples
MakePatientData
is the main function for
generating a synthetic dataset with covariates. It
simulates observations from a birth-shift-death process
for a number of synthetic "patients", using
ransim.N.true
. This provides data for
simulation studies toward assessing inference in a panel
data setting, with rates depending on multiple
covariates.
1 | MakePatientData(t, num.patients, patients.rates)
|
t |
A number giving the observation interval length |
num.patients |
An integer, the number of synthetic patients |
patients.rates |
A matrix in the format returned by
|
Each observation interval has a common fixed length given
by the argument t. For each patient, between 2 and 6
observation intervals are generated, and each begins with
between 2 and 12 initial particles. These numbers are
initialized uniformly at random, and passed in as
arguments to ransim.N.true
, with the true
rates set to the corresponding column of patients.rates.
A 5 \times m matrix where m is the number of total
observation intervals generated. The first row
corresponds to the patient ID, the second row gives the
initial number of particles for that observation
interval, the third through fifth column are in the
format returned by ransim.N.true
1 2 3 4 5 6 | num.patients = 10; t = .4
patients.design <- PatientDesignExample(num.patients)
beta.lam <- c(log(8), log(.6)); beta.v <- c( log(.5), log(.7)); beta.mu <- c(log(.8), log(.8))
betas <- c(beta.lam,beta.v,beta.mu)
patients.rates <- MakePatientRates(patients.design, betas)
MakePatientData(t, num.patients, patients.rates)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.