Use leave-p-out cross-validation (LpO CV) to compare an external control
analysis approach that uses the ecmeta
package to adjust for bias to a
standard approach that makes no adjustments. LpO CV uses p data points in the
data for testing and all other data points for training.
ecmeta_lpo_cv( data, p = 1, method = "ml", ecmeta_args = NULL, predict_args = NULL )
data | A data frame with columns |
---|---|
p | Number of data points to use for testing. Default is 1 which is leave-one-out cross validation. |
method | The method/software used to estimate the meta-analytic model
as in |
ecmeta_args | A named list containing additional arguments to pass
to |
predict_args | A named list containing additional arguments to pass to
|
A data frame where there are np
rows (n
= each time the model
is trained and tested; p
is the number of testing observations for each
of the n
iterations). Each row contains performance metrics.
LpO CV requires training and validating
the dataset \(C_p^n\) where \(n\) is the number of observations in the original dataset.
For each of the \(C_p^n\) iterations, a meta-analytic model is fit to the training
data using ecmeta::ecmeta()
and a prediction on the training set is made with
ecmeta::predict.ecmeta()
. Predictions that are adjusted with the meta-analytic method
are compared to those without using any adjustment.