inclusionsCount: Predicting the number of inclusions in a time period

Description Usage Arguments Details Value

View source: R/funcs_2.R

Description

Predict the number of total inclusions in future time periods using the passed model for the counts.

Usage

1
2
3
4
5
inclusionsCount(time.inclusion = NULL, period.inclusion = NULL,
  model.args = list("glm", formula = counts ~ time.periods +
  I(time.periods^2), family = poisson), do.before = NULL, do.after = NULL,
  predict.next = 10, boot = TRUE, boot.samples = 500, period.length,
  origin = NULL, numeric = TRUE)

Arguments

time.inclusion

Inclusion times for the patients in the study.

period.inclusion

Period of inclusion of the patients in the study. Either this or time.inlcusion has to be passed.

model.args

List with the arguments needed for the model, called via do.call(model.args[[1]], model.args[-1]).

do.before,

do.after Expressions to be executed before and after fitting the model.

predict.next

Number of periods of which to predict the inclusions.

boot

Calculate or not bootstrap CI intervals.

boot.samples

Number of samples for the CI intervals.

period.length,

origin, numeric Arguments passed to as.period if time.inclusion is used instead of period.inclusion.

Details

Data can be passed using time.inclusion with the days elapsed from the beginning of the RCT until the inclusion of each patient, or period.inclusion with the period of the study that the patient was recruited. In the first case peroid.length, origin and/or numeric can be passed also. For fitting a poisson glm for instance, set model.args as list("glm", formula, family = poisson). Then do.before and do.after can be used to modify or change the data as needed. substitute(df2$counts) can be used to get the data.

Value

A list with the counts predicted in each period using the model given, the cummulative counts, bootstrap CI for the counts and cummulative counts if asked, the data used and the last period.


gcastella/predRCT documentation built on May 16, 2019, 10:15 p.m.