Description Usage Arguments Value Examples
Compare the R-squared values in two objects class optWeight
or of
class r2_optWeight
. The former compares the R-squared values
for each outcome between the two optWeight
objects, while the latter
compares the R-squared values for the combined outcome of two r2_optWeight
objects.
1 |
object1 |
An object of either class |
object2 |
An object of either class |
comparison |
What type of comparison should be made. Possible choices include
|
alpha |
The function returns a |
Point estimate and confidence interval for the selected comparison
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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 <- optWeight(Y = Y, X = X, SL.library = c("SL.glm","SL.mean"),
#family = "gaussian", return.CV.SuperLearner = FALSE)
#perf.fit1 <- r2_optWeight(object = fit1, Y = Y, X = X, evalV = 5)
#fit2 <- optWeight(Y = Y, X = X[,1,drop=FALSE], SL.library = c("SL.glm","SL.mean"),
#family = "gaussian",return.CV.SuperLearner = FALSE)
#perf.fit2 <- r2_optWeight(object = fit2, Y = Y, X = X[,1,drop=FALSE], evalV = 5)
# compare cross-validated r-squared for each outcome
#comp <- r2_diff(fit1, fit2)
# comp
# compare cross-validated r-squared for combined outcome
#perf.comp <- r2_diff(perf.fit1, perf.fit2)
# perf.comp
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.