Sim.Data.STS: Simulates a dataset that can be used to assess surrogacy in...

View source: R/Sim.Data.STS.R

Sim.Data.STSR Documentation

Simulates a dataset that can be used to assess surrogacy in the single-trial setting

Description

The function Sim.Data.STS simulates a dataset that contains the variables Treat, Surr, True, and Pat.ID. The user can specify the total number of patients, the desired R_{indiv} value (also referred to as the adjusted association (\gamma) in the single-trial meta-analytic setting), and the desired means of the surrogate and the true endpoints in the experimental and control treatment groups.

Usage

Sim.Data.STS(N.Total=2000, R.Indiv.Target=.8, Means=c(0, 0, 0, 0), Seed=
sample(1:1000, size=1))

Arguments

N.Total

The total number of patients in the simulated dataset. Default 2000.

R.Indiv.Target

The desired R_{indiv} (or \gamma) value in the simulated dataset. Default 0.80.

Means

A vector that specifies the desired mean for the surrogate in the control treatment group, mean for the surrogate in the experimental treatment group, mean for the true endpoint in the control treatment group, and mean for the true endpoint in the experimental treatment group, respectively. Default c(0, 0, 0, 0).

Seed

The seed that is used to generate the dataset. Default sample(x=1:1000, size=1), i.e., a random number between 1 and 1000.

Details

The generated object Data.Observed.STS (of class data.frame) is placed in the workspace (for easy access).

Author(s)

Wim Van der Elst, Ariel Alonso, & Geert Molenberghs

See Also

Sim.Data.MTS, Single.Trial.RE.AA

Examples

# Simulate a dataset: 
Sim.Data.STS(N.Total=2000, R.Indiv.Target=.8, Means=c(1, 5, 20, 37), Seed=1) 

Surrogate documentation built on June 22, 2024, 9:16 a.m.