Description Usage Arguments Value Examples

Function that computes the optimal combination of multiple outcomes and a predictor of the optimal combination using Super Learning.

1 2 3 4 5 |

`Y` |
A |

`X` |
A |

`SL.library` |
A |

`family` |
An object of class |

`CV.SuperLearner.V` |
The number of CV folds for the calls to |

`seed` |
The seed to set before each internal call to |

`whichAlgorithm` |
What algorithm to compute optimal predictions and R^2 values for. |

`return.SuperLearner` |
A |

`return.CV.SuperLearner` |
A |

`return.IC` |
A |

`parallel` |
A |

`n.cores` |
A |

`...` |
Other arguments |

TO DO: Add return documentation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
# Example 1 -- simple fit
set.seed(1234)
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)
fit <- optWeight(Y = Y, X = X, seed = 1,
SL.library = c("SL.glm","SL.mean"))
# Example 2 -- simple fit with parallelization
#system.time(
# fit <- optWeight(Y = Y, X = X, SL.library = c("SL.glm","SL.mean"),
#parallel = TRUE, n.cores = 3)
#)
``` |

benkeser/r2weight documentation built on Sept. 16, 2017, 3:28 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.