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

β0\beta_0

in placebo group and

β0+β1\beta_0+\beta_1

in treatment group. Measurements after baseline have mean

β0+β2t\beta_0+\beta_2*t

in placebo group and

β0+β1+β2t+β3t\beta_0+\beta_1+\beta_2*t+\beta_3*t

in treatment group where

tt

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

β0\beta_0

to

β0\beta_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 tt that have to be generated: see 'Details'.

OD

percentage of observed overall dropout at last timepoint: see 'Details'.

Details

For reglist(c(β0F§,β1F§,β2F§,β3F§\beta_0^F\S,\beta_1^F\S,\beta_2^F\S,\beta_3^F\S), c(β0S,β1S,β2S,β3S\beta_0^S,\beta_1^S,\beta_2^S,\beta_3^S)) and variances sigma=(σF§,σS\sigma_F\S, \sigma_S) function r.gee.1subgroup generates data given correlation-variables ρ\rho and θ\theta as follows (and let t=0 be the baseline measurement):

Placebo group - complementary population yit=N(β0+β2t,σF§)y_{it}=N(\beta_0+\beta_2*t,\sigma_F\S), Placebo group - within subgroup yit=N(β0+β2t,σS)y_{it}=N(\beta_0+\beta_2*t,\sigma_S), Treatment group - complementary population yit=N(β0+β1+β2t+β3t,σF§)y_{it}=N(\beta_0+\beta_1+\beta_2*t+\beta_3*t,\sigma_F\S), Treatment group - within subgroup yit=N(β0+β1+β2t+β3t,σS)y_{it}=N(\beta_0+\beta_1+\beta_2*t+\beta_3*t,\sigma_S). Correlation between measurements - corr(ϵit,ϵio)=ρ(to)θcorr(\epsilon_it,\epsilon_io)=\rho^{(t-o)^\theta}

Argument k is the sample size allocation factor, i.e. the ratio between control and treatment. Let nCn_C and nTn_T denote sample sizes of control and treatment groups respectively, then k=nT/nCk = n_T/n_C.

Argument Time is the vector denoting all measuring-times, i. e. every value for tt.

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

[Package spass version 1.3 Index]