
Generate Simulated Subjects
Source:R/generics.R, R/SimLongitudinalClaretBruno.R, R/SimLongitudinalGSF.R, and 3 more
sampleSubjects.RdGenerate Simulated Subjects
Usage
sampleSubjects(object, subjects_df)
# S3 method for class 'SimLongitudinalClaretBruno'
sampleSubjects(object, subjects_df)
# S3 method for class 'SimLongitudinalGSF'
sampleSubjects(object, subjects_df)
# S3 method for class 'SimLongitudinalRandomSlope'
sampleSubjects(object, subjects_df)
# S3 method for class 'SimLongitudinalSteinFojo'
sampleSubjects(object, subjects_df)
# S3 method for class 'SimSurvival'
sampleSubjects(object, subjects_df)Details
The subjects_df argument should be a data.frame with 1 row per desired subject to create
with the following columns:
study(factor) the study identifier.arm(factor) the treatment arm identifier.subject(character) the subject identifier.
This method takes care of generating all the individual subject data required for the
sampleObservations method to generate the observations.
Examples
subjects <- data.frame(study = factor("S"), arm = factor("A"), subject = "1")
sim <- SimLongitudinalRandomSlope(slope_mu = 0.01, slope_sigma = 0.5)
sampleSubjects(sim, subjects)
#> study arm subject intercept slope_ind
#> 1 S A 1 50 1.093206