Surrogate (version 1.7)

Sim.Data.CounterfactualsBinBin: Simulate a dataset that contains counterfactuals for binary endpoints

Description

The function Sim.Data.CounterfactualsBinBin 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. The user can specify the number of patients and the desired probabilities of the vector of potential outcomes (i.e., \(\bold{{Y'}_c}\)=(T_0, T_1, S_0, S_1)).

Usage

Sim.Data.CounterfactualsBinBin(Pi_s=rep(1/16, 16), 
N.Total=2000, Seed=sample(1:1000, size=1))

Arguments

Pi_s

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}\). Default rep(1/16, 16).

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.

Value

An object of class Sim.Data.CounterfactualsBinBin 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\).

Details

The generated object Data.STSBinBin.Counter (which contains the counterfactuals) and Data.STSBinBin.Obs (the "observable data") (of class data.frame) is placed in the workspace.

Examples

Run this code
# NOT RUN {
## Generate a dataset with 2000 patients, and values 1/16
## for all proabilities between the counterfactuals:
Sim.Data.CounterfactualsBinBin(N.Total=2000)
# }

Run the code above in your browser using DataLab