negint2: A utility functon to calculate the mean exposure under...

Description Usage Arguments Details Value Author(s) Examples

View source: R/negint2.R

Description

This will calculate the mean exposure under different scenarios: 2: fixed follow-up with drop-out, 3: variable follow-up with a maximum (maxfu), 4: variable follow-up with a maximum and drop-out

Usage

1
2
3
negint2(ux=0.5,fixedfu=1,type=2,u=c(0.5,0.5,1),ut=c(0.5,1.0,1.5),
  tfix=ut[length(ut)]+0.5,maxfu=10.0,tchange=c(0,0.5,1),
  ratec=c(0.15,0.15,0.15),eps=1.0e-03)

Arguments

ux

the parameter a in (a*t)/(1+a*t)

fixedfu

the minimum follow-up time

type

follow-up type, type=2: fixed fu with fu time fixedfu but subject to censoring; type=3: depending on entry time, minimum fu is fixedfu and maximum fu is maxfu; type=4: same as 3 but subject to censoring

u

recruitment rate

ut

recruitment interval, must have the same length as u

tfix

fixed study duration, often equals to recruitment time plus minimum follow-up

maxfu

maximum follow-up time, should not be greater than tfix

tchange

a strictly increasing sequence of time points starting from zero at which the drop-out rate changes. The first element of tchange must be zero. The above rates and tchange must have the same length.

ratec

piecewise constant drop-out rate

eps

error tolerance for the numerical intergration

Details

Let τ_{min} and τ_{max} correspond to the minimum follow-up time taumin and the maximum follow-up time taumax. Let T_f, C, E and R be the follow-up time, the drop-out time, the study entry time and the total recruitment period(R is the last element of ut). For type 2 follow-up T_f=min(C,τ_{min}). For type 3 follow-up, T_f=min(R+τ_{min}-E,τ_{max}). For type 4 follow-up, T_f=min(R+τ_{min}-E,τ_{max},C). Let f be the density of T_f. We calculate

\int_0^{∞} t f(t)dt

and

\int_0^{∞} \frac{a t}{1+a t} f(t)dt

where a is the ux.

Value

mt

mean of (a*t)/(1+a*t)

tt

mean of t

vt

variance of t

Author(s)

Xiaodong Luo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
##calculating the exposure for type 4 follow-up
exp4=negint2(ux=0.5,fixedfu=1,type=2,u=c(0.5,0.5,1),ut=c(0.5,1.0,1.5),
  tfix=2.0,maxfu=1.0,tchange=c(0,0.5,1),
  ratec=c(0.15,0.15,0.15),eps=1.0e-03)
#mean exposure            
meanexp=exp4$tt
#var exposure
varexp=exp4$vt
c(meanexp,sqrt(varexp))
#mean of (ux*t)/(1+ux*t)
meanuxt=exp4$mt

NBDesign documentation built on Sept. 13, 2020, 5:14 p.m.