rand: rand functions to use in the rpsftm() formula

View source: R/rand.R

randR Documentation

rand functions to use in the rpsftm() formula

Description

A function that is defined to be used in the formula argument, and identified as specials in the terms() object

Usage

rand(arm, rx)

Arguments

arm

the randomised treatment arm. a factor with 2 levels, or numeric variable with values 0/1.

rx

the proportion of time on active treatment (arm=1 or the non-reference level of the factor)

Value

matrix with two columns named arm and rx. These can be used in the formula argument to rpsftm()

Author(s)

Simon Bond

See Also

print.rand, rpsftm

Examples

x <- with(immdef, rand(imm , 1 - xoyrs / progyrs ) )
x
class(x)
y <- as.data.frame(x)
head(y)

rpsftm documentation built on May 29, 2024, 2:37 a.m.