tidy.lmodel2 {broom} | R Documentation |
Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies cross models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
## S3 method for class 'lmodel2' tidy(x, ...)
x |
A |
... |
Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in |
There are always only two terms in an lmodel2
: "Intercept"
and "Slope"
. These are computed by four methods: OLS
(ordinary least squares), MA (major axis), SMA (standard major
axis), and RMA (ranged major axis).
A tibble::tibble within eight rows (one for each term estimated with each method) and columns:
method
: Either OLS/MA/SMA/RMA
term
: Either "Intercept" or "Slope"
estimate
: Estimated coefficient
conf.low
: Lower bound of 95\
conf.high
: Upper bound of 95\
Other lmodel2 tidiers:
glance.lmodel2()
if (require("lmodel2", quietly = TRUE)) { library(lmodel2) data(mod2ex2) Ex2.res <- lmodel2(Prey ~ Predators, data=mod2ex2, "relative", "relative", 99) Ex2.res tidy(Ex2.res) glance(Ex2.res) # this allows coefficient plots with ggplot2 library(ggplot2) ggplot(tidy(Ex2.res), aes(estimate, term, color = method)) + geom_point() + geom_errorbarh(aes(xmin = conf.low, xmax = conf.high)) + geom_errorbarh(aes(xmin = conf.low, xmax = conf.high)) }