View source: R/ard_emmeans_mean_difference.R
ard_emmeans_mean_difference | R Documentation |
This function calculates least-squares mean differences using the 'emmeans' package using the following
emmeans::emmeans(object = <regression model>, specs = ~ <primary covariate>) |> emmeans::contrast(method = "pairwise") |> summary(infer = TRUE, level = <confidence level>)
The arguments data
, formula
, method
, method.args
, package
are used
to construct the regression model via cardx::construct_model()
.
ard_emmeans_mean_difference(
data,
formula,
method,
method.args = list(),
package = "base",
response_type = c("continuous", "dichotomous"),
conf.level = 0.95,
primary_covariate = getElement(attr(stats::terms(formula), "term.labels"), 1L)
)
data |
( |
formula |
( |
method |
( |
method.args |
(named Note that this list may contain non-standard evaluation components.
If you are wrapping this function in other functions, the argument
must be passed in a way that does not evaluate the list, e.g.
using rlang's embrace operator |
package |
( |
response_type |
( |
conf.level |
(scalar |
primary_covariate |
( |
ARD data frame
ard_emmeans_mean_difference(
data = mtcars,
formula = mpg ~ am + cyl,
method = "lm"
)
ard_emmeans_mean_difference(
data = mtcars,
formula = vs ~ am + mpg,
method = "glm",
method.args = list(family = binomial),
response_type = "dichotomous"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.