Description Usage Arguments Value Examples
'match_pred_fn' takes an expression capturing a call to either 'lm' or 'glm' and replaces that call with a call to 'lm.pred' or 'glm.pred'.
1 | match_pred_fn(form_call_expr)
|
form_call_expr |
An expression containing a call to 'lm' or 'glm'. |
A list of functions.
Specifically, it returns the same as the functions 'lm.res' and 'glm.res'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(RGOB)
N <- 100
X <- rnorm(N)
Z <- sample(c(0,1), size=N, replace=TRUE)
Y <- 1 + 0.2 * X + 0.5*Z
lm_call <- expr(lm(Y ~ X + Z))
glm_call <- expr(glm(Y ~ X + Z))
match_pred_fn(lm_call) # equivalent to: lm.pred(Y ~ X + Z)
match_pred_fn(glm_call) # equivalent to: glm.pred(Y ~ X + Z)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.