Learn R Programming

confidenceSim (version 0.1.0)

getCurrentData: Get Current Data

Description

Get the data available at the time of the current analysis.

Usage

getCurrentData(datlist, looktime, n, as.followup = TRUE)

Value

Returns a subset of the data to use in interim analysis.

  • subjid: Subject ID from 1 to maximum sample size

  • arm: Treatment arm allocation for each subject

  • dat: Response for each subject (0 or 1)

  • arrival.day: Arrival time (days) for each subject throughout trial duration

Arguments

datlist

The entire data list generated at the start of the simulation.

looktime

The time of the current analysis point.

n

The number of subjects corresponding to this analysis point (n.at.look).

as.followup

If TRUE, the true looktime is when all n patient reach follow-up. If FALSE, looktime remains the time when the nth patient is enrolled. Default is TRUE.

Examples

Run this code
# using included data set
data(datlist)
# This example uses the default parlist parameters
looks <- seq(500,1000,100)

# get the data available at the first interim analysis
n.at.look <- looks[1]
looktime.interim <- datlist$arrival.day[n.at.look]
currdatlist.interim <- getCurrentData(datlist, looktime.interim, n.at.look, as.followup=TRUE)
# currdatlist.interim will have a new field `KNOWN`
#3 which indicates if a patients response is known (TRUE) or not (FALSE)

Run the code above in your browser using DataLab