set_recruitment: generate recruitment table

Description Usage Arguments Value Examples

View source: R/set_recruitment.R

Description

A function to build a recruitment dataframe by some general conditions e.g. targeted total number of recruitments per group and recruitment timePoints.

Usage

1
set_recruitment(targetN, timePoints, fn = "linear", ...)

Arguments

targetN

a vector of length 1 or two defining the targeted total number of recruitments. If targetN is of length tow the total number recruitments per group is defined. The first entry refers to the treatment group.

timePoints

a vector defining the timepoint of each recruitment or a positive number defining the amount of recruitments (needs time to be set).

fn

a string defining the shape of the cummulative recruitment. Default is set to "linear".

k

a positive number defining the k:1 treatment allocation (treatment:control). Optional, if targetN is vector of length two.

timeLimits

a vector of length two defining the timepoint of the first and the last recruitment. Optional if timePoints is a vector defining each timepoint of recruitment.

Value

a data.frame containing the number of recruitments of the treament and control group "T" and "C" per timepoint time.

Examples

1
2
3
4
5
6
7
# Two different approches to define a recruitment of 1071 patients
# with an allokation of 2:1 (treatment:control), where 24 batches of
# recruits are wanted. The recruitment is assumed to take place at the
# beginning of each month over 24 month.

set_recruitment(targetN=c(714,357), timePoints=0:23)
set_recruitment(targetN=1071, k=2, timePoints=24, timeLimits=c(0,23))

Knusprikus/BSSRed documentation built on July 6, 2020, 11:02 p.m.