SWD.datasampling: Sampling Response of individuals within a SWD model

Description Usage Arguments Value Examples

Description

Sample data (response) for given numbers of individuals by given group means within a SWD model and derivations

Usage

1
2
SWD.datasampling(I, TP, mu, theta, beta.j, sigma.alpha, X.i.j.0, N, sigma.e,
  sigma.ind = NULL, A = NULL, B = "0", C = 0, D = 0)

Arguments

I

number of clusters (design parameter)

TP

number of timepoints (design parameter)

mu

baseline mean (model parameter)

theta

treatment effect (model parameter)

beta.j

vector of time trents (model parameter)

sigma.alpha

between cluster variability as standard deviation (model parameter)

X.i.j.0

assumed treatment model matrix for a SWD study (model parameter)

N

number of individuals (fixed) for all clusters and timepoints

sigma.e

random error variability as standard deviation (model parameter)

sigma.ind

individual variability as standard deviation (model parameter), if it is an longitudinal model, by default (NULL) it is an cross-sectional model

A

derivation from perfect 100 percent effectiveness pattern

B

timepoint of cluster loss with 4 possibilities: "0": default - no cluster at no timepoint get lost, "1" - Cluster missing at random from timepoint 2 untill TP, "2" - Cluster is missing at beginning (1/3 of timepoints after the first), "3" - Cluster is missing at end (1/3 of the last timepoints).

C

number of cluster loss, by default zero. If a cluster get lost from time point i, all indiviual responses of that cluster will be deleted from timepoint i until timpeoint TP (end).

D

number of individuals loss, by default zero. If not zero, then individual responses to delete are selected at random from timepoints and clusters.

X.i.j

data model matrix of real intervention implementation (model parameter), by default (NULL) the same as the X.i.j.0

Value

Data frame with individuals intensities corresponds to the SWD model and full model parameter information and derivation information

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
noCl<-10
noT<-6
switches<-2
DM<-designMatrix.SWD(noCl,noT,switches)
#cross-sectional SWD (10 cluster and 6 time points)
#no derivation from perfect 100 percent effectiveness pattern
#no data loss (no missing)
#SWD.datasampling(I=noCl,TP=noT, mu=0,theta=1,beta.j=rep(1,noT),sigma.alpha=0.5, X.i.j.0=DM,N=10,sigma.e=1)
#cross-sectional SWD (10 cluster and 6 time points)
#no derivation from perfect 100 percent effectiveness pattern
#missing individuals
#SWD.datasampling(I=noCl,TP=noT, mu=0,theta=1,beta.j=rep(1,noT),sigma.alpha=0.5, X.i.j.0=DM,N=10,sigma.e=1, D=5)
#cross-sectional SWD (10 cluster and 6 time points)
#no derivation from perfect 100 percent effectiveness pattern
#missing 2 cluster at random
#SWD.datasampling(I=noCl,TP=noT, mu=0,theta=1,beta.j=rep(1,noT),sigma.alpha=0.5, X.i.j.0=DM,N=10,sigma.e=1 ,B="1", C=2)
#longitudinal SWD (10 cluster and 6 time points)
#no derivation from perfect 100 percent effectiveness pattern
#no data loss (no missing)
#SWD.datasampling(I=noCl,TP=noT, mu=0,theta=1,beta.j=rep(1,noT),sigma.alpha=0.5, X.i.j.0=DM,N=10,sigma.e=1, sigma.ind=0.5)

trutscheld/SWDsampling documentation built on June 1, 2019, 1:52 a.m.