eventsCount: Total number of expected events

Description Usage Arguments Value See Also

View source: R/funcs_2.R

Description

Calculates the total number of expected events (past and/or future) in a RCT in each time period.

Usage

1
2
3
4
5
eventsCount(data = NULL, time.inclusion = NULL, time.end = NULL,
  time.followup = NULL, delta, abandon, new.inclusions = NULL,
  origin = NULL, period.length, past = FALSE, boot = TRUE,
  boot.samples = 500, varnames = getOption("RCT_names_match"), surv.object,
  how.many = 1000, FUN = NULL)

Arguments

data

Defaults to NULL. Data frame with the inclusion times (named as inclusion), follow-up times (y) or ending times (end), withdrawal indicator (abandon) and censoring indicator (delta). You can provide time.inclusion, delta, abandon and time.end or time.followup instead.

time.inclusion

Ignored if data is not NULL. Vector with times of inclusion (numeric or date).

time.end

Ignored if data is not NULL. Vector with the times of end of follow-up (numeric or date). One of time.followup or time.end must be supplied (if data is not null)

time.followup

Ignored if data is not NULL. Numeric vector with the total time of follow-up. One of time.followup or time.end must be supplied (if data is not null)

delta

Ignored if data is not NULL. Censoring indicator: 1 if the event is observed, 0 otherwise

abandon

Ignored if data is not NULL. Withdrawal indicator: 1 if the patient is a withdrawal, abandons, or dies for other causes (etc). 0 otherwise.

new.inclusions

Numeric vector with the new patients included in each future time period.

origin

Date that marks the first included patient in the RCT.

period.length

Length of each time period.

past

Logical. Calculate the expected number of events in each past time periods in the data provided?

FUN

Survival function for calculating probabilities of event in each period.

Value

A list with

events

Numeric with the cummulative number of events in each period (past and future).

percent.events

Numeric with the percentage of events in the sample (sample size is modified in every period).

new.inclusions

Argument new.inclusions.

last.time

Highest time in the data: max(inclusion + followup).

data

Data frame constructed from the arguments provided (or just the data argument with some modifications, if provided).

survFun

Argument FUN.

origin

Argument origin or the origin assumed for the data (first inclusion, when the RCT started).

See Also

survs_plot, events_plot, inclusionsCount


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