| Title: | A Bayesian Surrogate Evaluation Test |
|---|---|
| Description: | An implementation of the Bayesian Surrogate Evaluation Test (BSET) for assessing the validity of surrogate markers in clinical trials. Provides hypothesis testing tools to evaluate whether a surrogate can reliably estimate the causal effect of a treatment on a primary outcome. Implements the imputation-based Bayesian methodology of Carlotti and Parast (2026) <doi:10.48550/arXiv.2603.14381>, extending the frequentist rank-based approach of Parast et al. (2024) <doi:10.1093/biomtc/ujad035>. Addresses key limitations of the frequentist method, including the lack of causal interpretability and the inability to adjust for covariates in the estimation process. |
| Authors: | Pietro Carlotti [aut, cre], Layla Parast [aut] |
| Maintainer: | Pietro Carlotti <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0 |
| Built: | 2026-06-05 10:44:01 UTC |
| Source: | https://github.com/pietrocarlotti/bset |
This function performs a Bayesian test for surrogate evaluation based on the
imputation-based methodology of Carlotti and Parast (2026). It calculates
credible intervals, the threshold used, and determines if the
surrogate is valid.
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
Bayesian_test( P_MCMC, alpha = 0.05, V_S_star, theta_true = NULL, V_Y_true = NULL )Bayesian_test( P_MCMC, alpha = 0.05, V_S_star, theta_true = NULL, V_Y_true = NULL )
P_MCMC |
A three-dimensional array of potential outcomes obtained via MCMC sampling with dimensions |
alpha |
Numeric. Significance level for the credible interval (default is 0.05). |
V_S_star |
Numeric. The value of |
theta_true |
Numeric (optional). The true value of |
V_Y_true |
Numeric (optional). The true value of |
A list containing:
V_Y_MCMC: Posterior draws for .
V_S_MCMC: Posterior draws for .
theta_MCMC: Posterior draws for .
CI: The calculated credible interval for .
threshold: The threshold value used in the test.
coverage: Logical indicating if theta_true falls within the CI (if theta_true is provided).
power: Logical indicating if the upper bound of CI is below threshold, which indicates that the test identifies the surrogate as valid.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
This function implements the Bayesian Surrogate Evaluation Test (BSET)
as proposed by Carlotti and Parast (2026). When X
is NULL (the default), the model is fit without covariates; when X
is provided, a multivariate regression model is used to adjust for baseline
covariates. In both cases the function fits a Bayesian model using Stan to
generate posterior samples for the parameters of interest, which are then
used to conduct a Bayesian hypothesis test for evaluating the validity of
the surrogate marker. A frequentist test is also performed for comparison.
BSET( data, Y, S, Z, X = NULL, delta_true = NULL, theta_true = NULL, seed = NULL, n_chains = 4, n_iter = 2000, burn_in_ratio = 0.25, a = 1, b = 1, alpha = 0.05, beta = 0.2, V_S_zero = 0.5, BF_alternative = "greater", root_tolerance = 1e-16, mu_0 = rep(0, 4), Sigma_0 = diag(4), intercept = TRUE, mu_beta = NULL, Sigma_beta = NULL, s = rep(1, 4), tau = 1, plot = FALSE, mute = TRUE, parallel = TRUE )BSET( data, Y, S, Z, X = NULL, delta_true = NULL, theta_true = NULL, seed = NULL, n_chains = 4, n_iter = 2000, burn_in_ratio = 0.25, a = 1, b = 1, alpha = 0.05, beta = 0.2, V_S_zero = 0.5, BF_alternative = "greater", root_tolerance = 1e-16, mu_0 = rep(0, 4), Sigma_0 = diag(4), intercept = TRUE, mu_beta = NULL, Sigma_beta = NULL, s = rep(1, 4), tau = 1, plot = FALSE, mute = TRUE, parallel = TRUE )
data |
A data frame containing the observed data. |
Y |
Character. Name of the outcome variable. |
S |
Character. Name of the surrogate variable. |
Z |
Character. Name of the treatment assignment variable. |
X |
Character vector. Names of the covariate columns to include in the model.
When |
delta_true |
The true value of delta, used to calculate frequentist coverage during simulations (optional). |
theta_true |
The true value of theta, used to calculate Bayesian coverage during simulations (optional). |
seed |
Random seed for reproducibility (optional. If not provided, a random seed will be generated). |
n_chains |
Number of MCMC chains to run (default is 4). |
n_iter |
Number of iterations per MCMC chain (default is 2000). |
burn_in_ratio |
Proportion of iterations to discard as burn-in (default is 0.25). |
a, b
|
Prior parameters for prior Beta distribution on V_S (default is a = 1, b = 1). |
alpha |
Type I error rate for the test (default is 0.05). |
beta |
Type II error rate for the test (default is 0.2). |
V_S_zero |
Value of V_S under the null hypothesis (default is 0.5). |
BF_alternative |
Alternative hypothesis for the Bayes factor test ("greater", "less" or "two.sided"). |
root_tolerance |
Numerical tolerance for root-finding algorithms (default is 1e-16). |
mu_0 |
Prior mean vector for the mean parameters. Used only when |
Sigma_0 |
Prior covariance matrix for the mean vector. Used only when |
intercept |
Logical. Whether to include an intercept in the regression model.
Used only when |
mu_beta |
Prior mean vector for the regression coefficients. Used only when |
Sigma_beta |
Prior covariance matrix for the regression coefficients. Used only when
|
s |
Prior scale parameters for the error variance (default is a vector of ones of length 4). |
tau |
Prior parameter for the LKJ correlation distribution (default is 1). |
plot |
Logical. Whether to plot the posterior distribution of theta (default is FALSE). |
mute |
Logical. Whether to suppress Stan output during model fitting (default is TRUE). |
parallel |
Logical. Whether to use parallel processing for MCMC sampling (default is TRUE). |
Without covariates (X = NULL), the Bayesian model is:
With covariates (X provided), the Bayesian model is:
with , , and as above.
This is a primary user-facing function of the package and includes working examples below.
A list containing:
stan_cores: The number of CPU cores used for MCMC sampling.
Bayesian_test: A list containing the results of the Bayesian test, including posterior samples and credible intervals.
frequentist_test: A list containing the results of the frequentist test, including point estimates and confidence intervals.
theta_posterior_plot: A ggplot object showing the posterior distribution of , with vertical lines indicating the credible interval, the threshold, and the true values of and (if provided).
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
Parast L, Cai T, Tian L (2024). “A rank-based approach to evaluate a surrogate marker in a small sample setting.” Biometrics, 80(1), ujad035.
# Generate data from the perfect surrogate setting of Parast et al. (2024) set.seed(123) data_no_X <- DGP_no_X( n = 100, p = 0.5, mu_star = c(6, 6, 2.5, 2.5), Sigma_star = kronecker(diag(2), matrix(c(3, 3, 3, 3.1), 2, 2)), model = "Gaussian" ) # Prepare the data frame df_no_X <- data.frame( Y = data_no_X$P_observed[, "Y"], S = data_no_X$P_observed[, "S"], Z = data_no_X$Z ) # Run BSET without covariates (requires Stan compilation, ~3 minutes) result_no_X <- BSET( data = df_no_X, Y = "Y", S = "S", Z = "Z", seed = 123, n_chains = 2, n_iter = 500 ) # Generate data from the setting of Carlotti and Parast (2026) with a binary covariate set.seed(123) data_X <- DGP_X_binary( n = 100, p = 0.5, q = 0.5, mu_0 = c(5, 5, 0, 0), mu_1 = c(5, -5, 0, -10), Sigma_0 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)), Sigma_1 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)) ) # Prepare the data frame df_X <- data.frame( Y = data_X$P_observed[, "Y"], S = data_X$P_observed[, "S"], Z = data_X$Z, X = data_X$X ) # Run BSET with covariates (requires Stan compilation, ~3 minutes) result_X <- BSET( data = df_X, Y = "Y", S = "S", Z = "Z", X = "X", seed = 123, n_chains = 2, n_iter = 500 )# Generate data from the perfect surrogate setting of Parast et al. (2024) set.seed(123) data_no_X <- DGP_no_X( n = 100, p = 0.5, mu_star = c(6, 6, 2.5, 2.5), Sigma_star = kronecker(diag(2), matrix(c(3, 3, 3, 3.1), 2, 2)), model = "Gaussian" ) # Prepare the data frame df_no_X <- data.frame( Y = data_no_X$P_observed[, "Y"], S = data_no_X$P_observed[, "S"], Z = data_no_X$Z ) # Run BSET without covariates (requires Stan compilation, ~3 minutes) result_no_X <- BSET( data = df_no_X, Y = "Y", S = "S", Z = "Z", seed = 123, n_chains = 2, n_iter = 500 ) # Generate data from the setting of Carlotti and Parast (2026) with a binary covariate set.seed(123) data_X <- DGP_X_binary( n = 100, p = 0.5, q = 0.5, mu_0 = c(5, 5, 0, 0), mu_1 = c(5, -5, 0, -10), Sigma_0 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)), Sigma_1 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)) ) # Prepare the data frame df_X <- data.frame( Y = data_X$P_observed[, "Y"], S = data_X$P_observed[, "S"], Z = data_X$Z, X = data_X$X ) # Run BSET with covariates (requires Stan compilation, ~3 minutes) result_X <- BSET( data = df_X, Y = "Y", S = "S", Z = "Z", X = "X", seed = 123, n_chains = 2, n_iter = 500 )
A dataset containing the grid of simulation results for Carlotti and Parast (2026) across two covariate settings: a binary covariate setting (setting 1) and a Gaussian covariate setting (setting 2). Each setting is run for 500 simulations, for a total of 1000 rows.
Carlotti_and_Parast_2026_simulations_gridCarlotti_and_Parast_2026_simulations_grid
A data frame with 1000 rows and 17 columns:
The index of the simulation setting: 1 for the binary
covariate setting (X_binary) and 2 for the Gaussian covariate
setting (X_Gaussian).
The index of the simulation run.
The sample size used.
The number of MCMC chains used.
The number of MCMC iterations.
The total number of simulations per setting.
The timestamp of execution.
The random seed used.
The alternative hypothesis used for the Bayes factor.
The threshold for the Bayesian test.
The threshold for the frequentist test.
The upper bound of the Bayesian credible interval.
The upper bound of the frequentist confidence interval.
Logical. Indicates if the true value is in the credible interval.
Logical. Indicates if the true value is in the confidence interval.
Logical. Indicates if the Bayesian test rejected the null.
Logical. Indicates if the frequentist test rejected the null.
Generated using the code in the simulations folder of the
BSET GitHub repository (https://github.com/PietroCarlotti/BSET).
This function calculates the probability mass function and cumulative distribution function of the Bayes factor defined in Carlotti and Parast (2026) for the following hypothesis test:
where is the surrogate's treatment effect on measured as
the probability
and is a hypothesized value under the null hypothesis. These
hypotheses can be tested by fitting the following Beta-binomial model to the
data:
where is the sample estimate of the surrogate's treatment
effect on computed as
The Bayes factor is then computed as the ratio of the marginal likelihoods under the alternatives:
where is the Beta function, is the
cumulative distribution function of the distribution,
and and are the shape parameters of the Beta prior.
Given the true value of , the distribution of the Bayes factor can
be computed by evaluating for all possible values of
and their corresponding probabilities under the Binomial
distribution with parameters and the true value of .
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
compute_BF_distribution( n, V_S_true, V_S_zero = 0.5, a = 1, b = 1, BF_alternative )compute_BF_distribution( n, V_S_true, V_S_zero = 0.5, a = 1, b = 1, BF_alternative )
n |
Integer. The sample size. |
V_S_true |
Numeric. The true value of treatment effect on the surrogate. |
V_S_zero |
Numeric. The hypothesized value of the surrogate's treatment effect under the null hypothesis (default is 0.5). |
a |
Numeric. First shape parameter alpha for the Beta prior (default is 1). |
b |
Numeric. Second shape parameter beta for the Beta prior (default is 1). |
BF_alternative |
Character. The type of alternative hypothesis: either |
A data frame containing:
BF_values: The possible values of the Bayes Factor.
BF_PMF: The probability mass function for the Bayes Factor.
BF_CDF: The cumulative distribution function for the Bayes Factor.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
from Parast et al. (2024)This function implements a Monte Carlo approach to estimate the parameter
from Parast et al. (2024). This parameter represents the
difference in treatment effects between the primary and surrogate outcomes,
both measured using the Mann-Whitney statistic.
compute_delta(MC_data)compute_delta(MC_data)
MC_data |
A list containing:
|
The function processes data from a chosen data generating process,
computing the Mann-Whitney U statistic for both the primary outcome
and the surrogate :
Then, it calculates
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
A list containing:
U_Y: Mann-Whitney U statistic for the primary outcome Y computed on P_observed.
U_S: Mann-Whitney U statistic for the surrogate S computed on P_observed.
delta: The difference U_Y - U_S.
Parast L, Cai T, Tian L (2024). “A rank-based approach to evaluate a surrogate marker in a small sample setting.” Biometrics, 80(1), ujad035.
This function iterates through the simulation settings defined in Carlotti
and Parast (2026) and estimates the true values of , ,
, , , and using a Monte Carlo
dataset generated according to the specified data-generating processes.
compute_estimands_Carlotti_and_Parast_2026(MC_samples)compute_estimands_Carlotti_and_Parast_2026(MC_samples)
MC_samples |
Integer. The number of Monte Carlo samples to generate per setting. |
The settings are defined as follows:
Setting 1: X binary
If :
If :
Setting 2: X Gaussian
This function is generally not intended to be called directly by the user. It is provided as a utility for computing the true parameter values for the simulation settings described in Carlotti and Parast (2026).
A data frame containing the Monte Carlo estimates for each setting:
setting: The index of the simulation setting.
U_Y_MC, U_S_MC, delta_MC: Parameters of interest from Parast et al. (2024).
V_Y_MC, V_S_MC, theta_MC: Parameters of interest from Carlotti and Parast (2026).
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
This function iterates through the four simulation settings defined in Parast
et al. (2024) and estimates the true values of , ,
, , , and using a Monte Carlo
dataset generated according to the specified data-generating processes.
compute_estimands_Parast_et_al_2024(MC_samples)compute_estimands_Parast_et_al_2024(MC_samples)
MC_samples |
Integer. The number of Monte Carlo samples to generate per setting. |
The settings are defined as follows:
Setting 1: Useless surrogate (Gaussian model)
Setting 2: Perfect surrogate (Gaussian model)
Setting 3: Imperfect surrogate (Gaussian model)
Setting 4: Misspecified model (non-Gaussian model)
This function is generally not intended to be called directly by the user. It is provided as a utility for computing the true parameter values for the simulation settings described in Parast et al. (2024).
A data frame containing the Monte Carlo estimates for each setting:
setting: The index of the simulation setting.
U_Y_MC, U_S_MC, delta_MC: Parameters of interest from Parast et al. (2024).
V_Y_MC, V_S_MC, theta_MC: Parameters of interest from Carlotti and Parast (2026).
Parast L, Cai T, Tian L (2024). “A rank-based approach to evaluate a surrogate marker in a small sample setting.” Biometrics, 80(1), ujad035.
from Carlotti and Parast (2026)This function implements a Monte Carlo approach to estimate the parameter
from Carlotti and Parast (2026). This parameter represents the
difference in treatment effects between the primary and surrogate outcomes,
both measured using the probability that the treated outcome is larger
than the control outcome.
compute_theta(MC_data)compute_theta(MC_data)
MC_data |
A list containing:
|
The function processes data from a chosen data generating process,
computing the sample probabilities for both the primary outcome and
the surrogate :
Then, it calculates
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
A list containing the true values:
V_Y: The Monte Carlo estimate of computed on P.
V_S: The Monte Carlo estimate of computed on P.
theta: The difference V_Y - V_S.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
from Carlotti and Parast (2026)This function determines the value that is used to compute the
surrogate validation threshold from Carlotti and Parast (2026):
where is the hypothesized value of the treatment effect on the
primary outcome (typically set equal to the estimate computed on the
available data) and is the value that satisfies the following power
constraint:
where is the quantile of the
Bayes factor distribution under the null hypothesis , and is the desired power of the
test. The function computes the distribution of the Bayes factor under the null
hypothesis, derives the critical value , and then
uses a root-finding algorithm to solve for the value of that
satisfies the power constraint.
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
compute_V_S_star( n, alpha = 0.05, beta = 0.2, V_S_zero = 0.5, a = 1, b = 1, BF_alternative = "greater", root_tolerance = 1e-16 )compute_V_S_star( n, alpha = 0.05, beta = 0.2, V_S_zero = 0.5, a = 1, b = 1, BF_alternative = "greater", root_tolerance = 1e-16 )
n |
Integer. Sample size. |
alpha |
Numeric. Type I error rate (default is 0.05). |
beta |
Numeric. Type II error rate (default is 0.2). |
V_S_zero |
Numeric. The hypothesized value of the surrogate's treatment effect under the null hypothesis (default is 0.5). |
a |
Numeric. First shape parameter alpha for the Beta prior (default is 1). |
b |
Numeric. Second shape parameter beta for the Beta prior (default is 1). |
BF_alternative |
Character. The type of alternative hypothesis: either |
root_tolerance |
Numeric. Tolerance level for the root-finding algorithm (default is 1e-16). |
A list containing:
BF_alpha: The critical value of the Bayes factor corresponding to the specified alpha level.
V_S_star: The value of that satisfies the power constraint for the surrogate validation test.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
This function generates potential outcomes from the simulation settings described in Parast et al. (2024). It creates a dataset of potential outcomes
and observed outcomes
based on a random treatment assignment .
DGP_no_X( n, p, mu_star = NULL, Sigma_star = NULL, model = c("Gaussian", "misspecified") )DGP_no_X( n, p, mu_star = NULL, Sigma_star = NULL, model = c("Gaussian", "misspecified") )
n |
Integer. Total sample size. |
p |
Numeric. Probability of being assigned to the treatment group (Z=1). |
mu_star |
Numeric vector. The mean vector for |
Sigma_star |
Matrix. The covariance matrix for |
model |
Character. The type of data generation: |
The function supports two types of data-generating processes:
Gaussian model: Potential outcomes are drawn from a multivariate normal distribution:
Non-linear model: Potential outcomes for the surrogate are generated from a non-Gaussian distribution, and the potential outcomes for the primary outcome are generated from a non-linear function of the surrogate plus non-Gaussian noise.
A list containing:
Z: Treatment assignment vector.
n1: Number of treated units.
n0: Number of control units.
P: Full matrix of potential outcomes.
P_observed: Observed outcomes corresponding to the assigned treatment .
P_unobserved: Counterfactual outcomes under the opposite treatment.
This function is useful for generating synthetic data to test or explore
the method, for instance to verify the behavior of BSET_no_X under
known simulation settings.
Parast L, Cai T, Tian L (2024). “A rank-based approach to evaluate a surrogate marker in a small sample setting.” Biometrics, 80(1), ujad035.
set.seed(123) data <- DGP_no_X( n = 100, p = 0.5, mu_star = c(6, 6, 2.5, 2.5), Sigma_star = kronecker(diag(2), matrix(c(3, 3, 3, 3.1), 2, 2)), model = "Gaussian" )set.seed(123) data <- DGP_no_X( n = 100, p = 0.5, mu_star = c(6, 6, 2.5, 2.5), Sigma_star = kronecker(diag(2), matrix(c(3, 3, 3, 3.1), 2, 2)), model = "Gaussian" )
This function generates potential outcomes from a data generating process similar to the one described in Parast et al. (2024), but with the addition of a binary covariate X. It creates a dataset of potential outcomes
and observed outcomes
based on a random treatment assignment .
DGP_X_binary(n, p, q, mu_0, mu_1, Sigma_0, Sigma_1)DGP_X_binary(n, p, q, mu_0, mu_1, Sigma_0, Sigma_1)
n |
Integer. Total sample size. |
p |
Numeric. Probability of being assigned to the treatment group |
q |
Numeric. Probability of the binary covariate X being 1. |
mu_0 |
Numeric vector. Mean vector for |
mu_1 |
Numeric vector. Mean vector for |
Sigma_0 |
Matrix. Covariance matrix for |
Sigma_1 |
Matrix. Covariance matrix for |
The potential outcomes are generated from multivariate normal
distributions with different mean vectors and covariance matrices depending
on the value of . Specifically:
A list containing:
X: The binary covariate vector.
n_X1: Number of units with .
n_X0: Number of units with .
Z: Treatment assignment vector.
n1: Number of treated units.
n0: Number of control units.
P: Full matrix of potential outcomes.
P_observed: Observed outcomes corresponding to the assigned treatment .
P_unobserved: Counterfactual outcomes under the opposite treatment.
This function is useful for generating synthetic data to test or explore
the method, for instance to verify the behavior of BSET_X under
known simulation settings.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
set.seed(123) data <- DGP_X_binary( n = 100, p = 0.5, q = 0.5, mu_0 = c(5, 5, 0, 0), mu_1 = c(5, -5, 0, -10), Sigma_0 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)), Sigma_1 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)) )set.seed(123) data <- DGP_X_binary( n = 100, p = 0.5, q = 0.5, mu_0 = c(5, 5, 0, 0), mu_1 = c(5, -5, 0, -10), Sigma_0 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)), Sigma_1 = kronecker(diag(2), matrix(c(1, 1, 1, 2), 2, 2)) )
This function generates potential outcomes from a data generating process similar to the one described in Parast et al. (2024), but with the addition of a Gaussian covariate X. It creates a dataset of potential outcomes
and observed outcomes
based on a random treatment assignment .
DGP_X_Gaussian(n, p, beta, Sigma, m, s)DGP_X_Gaussian(n, p, beta, Sigma, m, s)
n |
Integer. Total sample size. |
p |
Numeric. Probability of being assigned to the treatment group |
beta |
Numeric vector. Coefficients for the linear function of the covariate |
Sigma |
Matrix. Covariance matrix for the potential outcomes. |
m |
Numeric. Mean of the Gaussian covariate |
s |
Numeric. Standard deviation of the Gaussian covariate |
The potential outcomes are generated from a multivariate normal
distribution with mean vector and covariance matrix that depend on the
value of . Specifically, the mean vector is a linear function of :
and the covariance matrix is constant across values of :
A list containing:
X: The Gaussian covariate vector.
Z: Treatment assignment vector.
n1: Number of treated units.
n0: Number of control units.
P: Full matrix of potential outcomes.
P_observed: Observed outcomes corresponding to the assigned treatment .
P_unobserved: Counterfactual outcomes under the opposite treatment.
This function is useful for generating synthetic data to test or explore
the method, for instance to verify the behavior of BSET_X under
known simulation settings.
Carlotti P, Parast L (2026). “A Bayesian Critique of Rank-Based Methods for Surrogate Marker Evaluation.” arXiv preprint arXiv:2603.14381.
set.seed(123) data <- DGP_X_Gaussian( n = 100, p = 0.5, beta = c(1, 7, 0, 6), Sigma = 0.5 * diag(4), m = 3, s = 1 )set.seed(123) data <- DGP_X_Gaussian( n = 100, p = 0.5, beta = c(1, 7, 0, 6), Sigma = 0.5 * diag(4), m = 3, s = 1 )
A dataset containing the Monte Carlo estimates of the parameters of interest for the two simulation settings considered in Carlotti and Parast (2026): setting 1 (binary covariate) and setting 2 (Gaussian covariate).
estimands_Carlotti_and_Parast_2026estimands_Carlotti_and_Parast_2026
A data frame with 2 rows and 7 columns:
The index of the simulation setting.
Monte Carlo estimate of .
Monte Carlo estimate of .
Monte Carlo estimate of .
Monte Carlo estimate of .
Monte Carlo estimate of .
Monte Carlo estimate of .
Computed using the function compute_estimands_Carlotti_and_Parast_2026(1000000).
A dataset containing the Monte Carlo estimates of the parameters of interest for the simulation settings considered in Parast et al. (2024).
estimands_Parast_et_al_2024estimands_Parast_et_al_2024
A data frame with 4 rows and 7 columns:
The index of the simulation setting.
Numeric vector of Monte Carlo estimates.
Numeric vector of Monte Carlo estimates.
Numeric vector of Monte Carlo estimates.
Numeric vector of Monte Carlo estimates.
Numeric vector of Monte Carlo estimates.
Numeric vector of Monte Carlo estimates.
Computed using the function compute_estimands_Parast_et_al_2024(1000000).
This function performs a frequentist test for surrogate evaluation based on
the rank-based methodology of Parast et al. (2024). It calculates confidence
intervals, the threshold used, and determines if the surrogate is
valid.
This function is generally not intended to be called directly by the user
and is instead used internally within BSET_no_X and BSET_X.
frequentist_test(P_observed, Z, alpha = 0.05, beta = 0.2, delta_true = NULL)frequentist_test(P_observed, Z, alpha = 0.05, beta = 0.2, delta_true = NULL)
P_observed |
Observed outcomes |
Z |
Treatment assignment vector. |
alpha |
Numeric. Significance level for the confidence interval (default is 0.05). |
beta |
Numeric. Type II error rate (default is 0.2). |
delta_true |
Numeric (optional). The true value of |
A list containing:
CI: The calculated confidence interval for .
threshold: The threshold value used in the test.
coverage: Logical indicating if delta_true falls within the CI
(if delta_true is provided).
power: Logical indicating if the upper bound of CI is below threshold, which indicates that the test identifies the surrogate as valid.
Parast L, Cai T, Tian L (2024). “A rank-based approach to evaluate a surrogate marker in a small sample setting.” Biometrics, 80(1), ujad035.
A dataset containing the grid of simulation results for Parast et al. (2024).
Parast_et_al_2024_simulations_gridParast_et_al_2024_simulations_grid
A data frame with multiple columns:
The index of the simulation setting.
The index of the simulation run.
The sample size used.
The number of MCMC chains used.
The number of MCMC iterations.
The total number of simulations.
The timestamp of execution.
The random seed used.
The alternative hypothesis used for the Bayes factor.
The threshold for the Bayesian test.
The threshold for the frequentist test.
The upper bound of the Bayesian credible interval.
The upper bound of the frequentist confidence interval.
Logical. Indicates if the true value is in the credible interval.
Logical. Indicates if the true value is in the confidence interval.
Logical. Indicates if the Bayesian test rejected the null.
Logical. Indicates if the frequentist test rejected the null.
Generated using the code in the simulations folder of the
BSET GitHub repository (https://github.com/PietroCarlotti/BSET).