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

View source: R/SimDataSTSBinBin.R

Sim.Data.STSBinBinR Documentation

Simulates a dataset that can be used to assess surrogacy in the single trial setting when S and T are binary endpoints

Description

The function Sim.Data.STSBinBin simulates a dataset that contains four (binary) counterfactuals (i.e., potential outcomes) and a (binary) treatment indicator. The counterfactuals T_0 and T_1 denote the true endpoints of a patient under the control and the experimental treatments, respectively, and the counterfactuals S_0 and S_1 denote the surrogate endpoints of the patient under the control and the experimental treatments, respectively. In addition, the function provides the "observable" data based on the dataset of the counterfactuals, i.e., the S and T endpoints given the treatment that was allocated to a patient. The user can specify the assumption regarding monotonicity that should be made to generate the data (no monotonicity, monotonicity for S alone, monotonicity for T alone, or monotonicity for both S and T).

Usage

Sim.Data.STSBinBin(Monotonicity=c("No"), N.Total=2000, Seed)

Arguments

Monotonicity

The assumption regarding monotonicity that should be made when the data are generated, i.e., Monotonicity="No" (no monotonicity assumed), Monotonicity="True.Endp" (monotonicity assumed for the true endpoint alone), Monotonicity="Surr.Endp" (monotonicity assumed for the surrogate endpoint alone), and Monotonicity="Surr.True.Endp" (monotonicity assumed for both endpoints). Default Monotonicity="No".

N.Total

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

Seed

A 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 objects Data.STSBinBin_Counterfactuals (which contains the counterfactuals) and Data.STSBinBin_Obs (which contains the observable data) of class data.frame are placed in the workspace. Other relevant output can be accessed based on the fitted object (see Value below)

Value

An object of class Sim.Data.STSBinBin with components,

Data.STSBinBin.Obs

The generated dataset that contains the "observed" surrogate endrpoint, true endpoint, and assigned treatment.

Data.STSBinBin.Counter

The generated dataset that contains the counterfactuals.

Vector_Pi

The vector of probabilities of the potential outcomes, i.e., pi_{0000}, pi_{0100}, pi_{0010}, pi_{0001}, pi_{0101}, pi_{1000}, pi_{1010}, pi_{1001}, pi_{1110}, pi_{1101}, pi_{1011}, pi_{1111}, pi_{0110}, pi_{0011}, pi_{0111}, pi_{1100}.

Pi_Marginals

The vector of marginal probabilities \pi_{1 \cdot 1 \cdot}, \pi_{0 \cdot 1 \cdot}, \pi_{1 \cdot 0 \cdot}, \pi_{0 \cdot 0 \cdot}, \pi_{\cdot 1 \cdot 1}, \pi_{\cdot 1 \cdot 0}, \pi_{\cdot 0 \cdot 1}, \pi_{\cdot 0 \cdot 0}.

True.R2_H

The true R_H^2 value.

True.Theta_T

The true odds ratio for T.

True.Theta_S

The true odds ratio for S.

Author(s)

Wim Van der Elst, Ariel Alonso, & Geert Molenberghs

Examples

## Generate a dataset with 2000 patients, 
## assuming no monotonicity:
Sim.Data.STSBinBin(Monotonicity=c("No"), N.Total=200)

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