Learn R Programming

gsDesign2 (version 1.1.3)

event_diff: Considering the enrollment rate, failure rate, and randomization ratio, calculate the difference between the targeted number of events and the accumulated events at time x

Description

A helper function passed to uniroot()

Usage

event_diff(x, enroll_rate, fail_rate, ratio, target_event)

Value

A single numeric value that represents the difference between the expected number of events for the provided duration (x) and the targeted number of events (target_event)

Arguments

x

Duration

enroll_rate

An enroll_rate data frame with or without stratum created by define_enroll_rate().

fail_rate

A fail_rate data frame with or without stratum created by define_fail_rate().

ratio

Experimental:Control randomization ratio.

target_event

The targeted number of events to be achieved.