r.gee.1subgroup {spass} | R Documentation |
Generate dataset of normal distributed repeated observations in a one subgroup design
Description
r.gee.1subgroup
generates data for a design with one subgroup within a full population. Each baseline-observation is normal distributed with mean
in placebo group and
in treatment group. Measurements after baseline have mean
in placebo group and
in treatment group where
is the measurement time. Whether the effect can be found solely in the subgroup or additionally a certain amount outside of the subgroup can be specified as well as a potential different covariance-structure within subgroup and in the complementary subgroup.
Usage
r.gee.1subgroup(n, reg, sigma, rho, theta, tau, k, Time, OD)
Arguments
n |
overall sample size for the overall population |
reg |
list containing coefficients
to
for complementary population, |
sigma |
vector with standard deviations for generated observations c(complementary population, subpopulation). |
rho |
variable used together with |
theta |
variable used together with |
tau |
subgroup prevalence. |
k |
sample size allocation factor between treatment groups: see 'Details'. |
Time |
list of timepoints |
OD |
percentage of observed overall dropout at last timepoint: see 'Details'. |
Details
For reg
list
(c(), c(
)) and variances
sigma
=() function
r.gee.1subgroup
generates data given correlation-variables and
as follows (and let t=0 be the baseline measurement):
Placebo group - complementary population ,
Placebo group - within subgroup
,
Treatment group - complementary population
,
Treatment group - within subgroup
.
Correlation between measurements -
Argument k
is the sample size allocation factor, i.e. the ratio between control and treatment. Let and
denote sample sizes of control and treatment groups respectively, then
.
Argument Time
is the vector denoting all measuring-times, i. e. every value for .
Argument OD
sets the overall dropout rate observed at the last timepoint. For OD
=0.5, 50 percent of all observation had a dropout event at some point. If a subject experienced a dropout the starting time of the dropout is equally distributed over all timepoints.
Value
r.gee.1subgroup
returns a list with 7 different entries. Every Matrix rows are the simulated subjects and the columns are the observed time points.
The first list element is a vector containing subject ids. The second element contains a matrix with the outcomes of a subject with row being the subjects and columns being the measuring-timepoints Elements 3 to 5 return matrices with the information of which patients have baseline-measurements, which patients belong to treatment and which to control and what are the observed timepoints for each patient respectively. The sixth entry returns a matrix which contains the residuals of each measurement. The seventh entry returns the sub-population identification.
Source
r.gee.1subgroup
uses code contributed by Roland Gerard Gera
Examples
set.seed(2015)
dataset<-r.gee.1subgroup(n=200, reg=list(c(0,0,0,0.1),c(0,0,0,0.1)), sigma=c(3,2.5),
tau=0.5, rho=0.25, theta=1, k=1.5, Time=c(0:5), OD=0)
dataset