Description Usage Arguments Details Value Author(s) Examples
Interfaces to arm
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 41 42 43 44 45 | ## Not run:
library(intubate)
library(magrittr)
library(arm)
## ntbt_bayesglm: Bayesian generalized linear models
n <- 100
x1 <- rnorm (n)
x2 <- rbinom (n, 1, .5)
b0 <- 1
b1 <- 1.5
b2 <- 2
y <- rbinom(n, 1, invlogit(b0+b1*x1+b2*x2))
dta <- data.frame(y, x1, x2)
## Original function to interface
bayesglm(y ~ x1 + x2, family = binomial(link="logit"), data = dta,
prior.scale = Inf, prior.df = Inf)
## The interface puts data as first parameter
ntbt_bayesglm(dta, y ~ x1 + x2, family = binomial(link="logit"),
prior.scale = Inf, prior.df = Inf)
## so it can be used easily in a pipeline.
dta %>%
ntbt_bayesglm(y ~ x1 + x2, family = binomial(link="logit"),
prior.scale = Inf, prior.df = Inf)
## ntbt_bayespolr: Bayesian Ordered Logistic or Probit Regression
## Original function to interface
bayespolr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing,
prior.scale = Inf, prior.df = Inf)
## The interface puts data as first parameter
ntbt_bayespolr(housing, Sat ~ Infl + Type + Cont, weights = Freq,
prior.scale = Inf, prior.df = Inf)
## so it can be used easily in a pipeline.
housing %>%
ntbt_bayespolr(Sat ~ Infl + Type + Cont, weights = Freq,
prior.scale = Inf, prior.df = Inf)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.