spass (version 1.2)

r.gee.1subgroup: 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 $$\beta_0$$ in placebo group and $$\beta_0+\beta_1$$ in treatment group. Measurements after baseline have mean $$\beta_0+\beta_2*t$$ in placebo group and $$\beta_0+\beta_1+\beta_2*t+\beta_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

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 $$\beta_0$$ to $$\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 \(t\) that have to be generated: see 'Details'.

OD

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

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.

Details

For reglist(c(\(\beta_0^F\S,\beta_1^F\S,\beta_2^F\S,\beta_3^F\S\)), c(\(\beta_0^S,\beta_1^S,\beta_2^S,\beta_3^S\))) and variances sigma=(\(\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 \(y_{it}=N(\beta_0+\beta_2*t,\sigma_F\S)\), Placebo group - within subgroup \(y_{it}=N(\beta_0+\beta_2*t,\sigma_S)\), Treatment group - complementary population \(y_{it}=N(\beta_0+\beta_1+\beta_2*t+\beta_3*t,\sigma_F\S)\), Treatment group - within subgroup \(y_{it}=N(\beta_0+\beta_1+\beta_2*t+\beta_3*t,\sigma_S)\). Correlation between measurements - \(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 \(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.

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab