Description Usage Arguments Details Value Author(s) Examples

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

1 2 3 |

`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 |

`u` |
recruitment rate |

`ut` |
recruitment interval, must have the same length as |

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

`maxfu` |
maximum follow-up time, should not be greater than |

`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 |

`ratec` |
piecewise constant drop-out rate |

`eps` |
error tolerance for the numerical intergration |

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`

.

`mt` |
mean of (a*t)/(1+a*t) |

`tt` |
mean of t |

`vt` |
variance of t |

Xiaodong Luo

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
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.