Description Usage Arguments Details Value Author(s) Examples
Interfaces to glmx
functions that can be used
in a pipeline implemented by magrittr
.
1 2 |
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
library(intubate)
library(magrittr)
library(glmx)
## ntbt_glmx: Generalized Linear Models with Extra Parameters
set.seed(1)
d <- data.frame(x = runif(200, -1, 1))
d$y <- rnbinom(200, mu = exp(0 + 3 * d$x), size = 1)
require("MASS")
## Original function to interface
glmx(y ~ x, data = d, family = negative.binomial, xlink = "log", xstart = 0)
## The interface puts data as first parameter
ntbt_glmx(d, y ~ x, family = negative.binomial, xlink = "log", xstart = 0)
## so it can be used easily in a pipeline.
d %>%
ntbt_glmx(y ~ x, family = negative.binomial, xlink = "log", xstart = 0)
## ntbt_hetglm: Heteroskedastic Binary Response GLMs
n <- 200
x <- rnorm(n)
ystar <- 1 + x + rnorm(n, sd = exp(x))
y <- factor(ystar > 0)
dta <- data.frame(x, y)
## Original function to interface
hetglm(y ~ x | 1, data = dta)
## The interface puts data as first parameter
ntbt_hetglm(dta, y ~ x | 1)
## so it can be used easily in a pipeline.
dta %>%
ntbt_hetglm(y ~ x | 1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.