Description Usage Arguments Value Examples
Compare measures of association between two fits
1 2 3 4 5 6 | compare_cvma(object1, object2, contrast = "diff",
compare_control = list(f = function(h_cv_measures) { h_cv_measures
}, f_inv = function(h_cv_measures) { h_cv_measures }, h =
function(cv_measure1, cv_measure2) { cv_measure1 - cv_measure2 },
fh_grad = function(cv_measure1, cv_measure2) { c(1, -1) }, null = 0),
alpha = 0.05)
|
object1 |
An object of class |
object2 |
An object of class |
contrast |
A character indicating what contrast to take. Can be |
compare_control |
Contains information regarding format of the contrast we are interested in, its inverse function,
type of contrast, IC components of the corresponding covariance calculation, and null hypothesis.
Defaults to functions necessary for |
alpha |
Confidence intervals of 1 - alpha. |
Estimates, CI, and p-value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(1234)
library(SuperLearner)
library(future)
X <- data.frame(x1=runif(n=100,0,5), x2=runif(n=100,0,5))
Y1 <- rnorm(100, X$x1 + X$x2, 1)
Y2 <- rnorm(100, X$x1 + X$x2, 3)
Y <- data.frame(Y1 = Y1, Y2 = Y2)
fit1 <- cvma(Y = Y, X = X, V = 5,
learners = c("SL.glm","SL.mean"))
fit2 <- cvma(Y = Y, X = X[,-2,drop = FALSE], V = 5,
learners = c("SL.glm","SL.mean"))
# difference in R^2
compare_cvma(fit1, fit2, "diff")
# ratio of R^2, symmetric CI
compare_cvma(fit1, fit2, "ratio")
# ratio of R^2, CI symmetric on log-scale
compare_cvma(fit1, fit2, "logratio")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.