r.gee.1subgroup: Generate dataset of normal distributed repeated observations...

Description Usage Arguments Details Value Source Examples

View source: R/r.gee.1subgroup.r

Description

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.

Usage

1
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

β_0

to

β_0

for complementary population, reg[[1]] and subpopulation, reg[[2]]: see 'Details'.

sigma

vector with standard deviations for generated observations c(complementary population, subpopulation).

rho

variable used together with theta to describe correlation between two adjacent timepoints: see 'Details'.

theta

variable used together with rho to describe correlation between two adjacent timepoints: see 'Details'.

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'.

Details

For reglist(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.

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

1
2
3
4
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

spass documentation built on Jan. 13, 2021, 7:57 p.m.

Related to r.gee.1subgroup in spass...