Description Usage Arguments Details Value Source Examples
View source: R/r.gee.1subgroup.r
r.gee.1subgroup
generates data for a design with one subgroup within a full population. Each baseline-observation is normal distributed with mean
β_0
in placebo group and
β_0+β_1
in treatment group. Measurements after baseline have mean
β_0+β_2*t
in placebo group and
β_0+β_1+β_2*t+β_3*t
in treatment group where
t
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.
1 | r.gee.1subgroup(n, reg, sigma, rho, theta, tau, k, Time, OD)
|
n |
overall sample size for the overall population |
reg |
list containing coefficients β_0 to β_0 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 t that have to be generated: see 'Details'. |
OD |
percentage of observed overall dropout at last timepoint: see 'Details'. |
For reg
list
(c(β_0^F\S,β_1^F\S,β_2^F\S,β_3^F\S), c(β_0^S,β_1^S,β_2^S,β_3^S)) and variances sigma
=(σ_F\S, σ_S) function r.gee.1subgroup
generates data given correlation-variables ρ and θ as follows (and let t=0 be the baseline measurement):
Placebo group - complementary population y_{it}=N(β_0+β_2*t,σ_F\S), Placebo group - within subgroup y_{it}=N(β_0+β_2*t,σ_S), Treatment group - complementary population y_{it}=N(β_0+β_1+β_2*t+β_3*t,σ_F\S), Treatment group - within subgroup y_{it}=N(β_0+β_1+β_2*t+β_3*t,σ_S). Correlation between measurements - corr(ε_it,ε_io)=ρ^{(t-o)^θ}
Argument k
is the sample size allocation factor, i.e. the ratio between control and treatment. Let n_C and n_T denote sample sizes of control and treatment groups respectively, then k = n_T/n_C.
Argument Time
is the vector denoting all measuring-times, i. e. every value for t.
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.
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.
r.gee.1subgroup
uses code contributed by Roland Gerard Gera
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.