View source: R/fit_model_BinCont_copula.R
fit_copula_model_BinCont | R Documentation |
The function fit_copula_model_BinCont()
fits the copula model for a
continuous surrogate endpoint and binary true endpoint. Because the bivariate
distributions of the surrogate-true endpoint pairs are functionally
independent across treatment groups, a bivariate distribution is fitted in
each treatment group separately.
fit_copula_model_BinCont(
data,
copula_family,
marginal_surrogate,
marginal_surrogate_estimator = NULL,
twostep = FALSE,
fitted_model = NULL,
maxit = 500,
method = "BFGS"
)
data |
A data frame in the correct format (See details). |
copula_family |
One of the following parametric copula families:
|
marginal_surrogate |
Marginal distribution for the surrogate. For all
available options, see |
marginal_surrogate_estimator |
Not yet implemented |
twostep |
(boolean) if |
fitted_model |
Fitted model from which initial values are extracted. If
|
maxit |
Maximum number of iterations for the numeric optimization, defaults to 500. |
method |
Optimization algorithm for maximizing the objective function.
For all options, see |
WIP
# Load Schizophrenia data set.
data("Schizo_BinCont")
# Perform listwise deletion.
na = is.na(Schizo_BinCont$CGI_Bin) | is.na(Schizo_BinCont$PANSS)
X = Schizo_BinCont$PANSS[!na]
Y = Schizo_BinCont$CGI_Bin[!na]
Treat = Schizo_BinCont$Treat[!na]
# Ensure that the treatment variable is binary.
Treat = ifelse(Treat == 1, 1, 0)
data = data.frame(X,
Y,
Treat)
# Fit copula model.
fitted_model = fit_copula_model_BinCont(data, "clayton", "normal", twostep = FALSE)
# Perform sensitivity analysis with a very low number of replications.
sens_results = sensitivity_analysis_BinCont_copula(
fitted_model,
10,
lower = c(-1,-1,-1,-1),
upper = c(1, 1, 1, 1),
n_prec = 1e3
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.