artlm.con | R Documentation |
Given an art
model, build a linear model from data aligned or
aligned-and-ranked with ART-C alignment procedure by the specified term in
the model.
artlm.con(m, term, response = "art", factor.contrasts = "contr.sum", ...)
m |
An object of class |
term |
A character vector indicating the effect term in
the transformed data in |
response |
Which response to use: the aligned (with ART-C) response
( |
factor.contrasts |
The name of the contrast-generating function to be
applied by default to fixed effect factors. Sets the the first element of
|
... |
Additional arguments passed to |
This function is used internally by art.con
to construct
linear models for contrasts using the ART-C procedure (Elkin et al. 2021).
It is typically not necessary to use this function directly to conduct contrasts using
the ART-C procedure, you can use art.con
instead, which will
ensure that the correct model and contrast test is run. However, should you
wish to use the ART-C procedure with a different contrast test
than provided by art.con
, you may with to use this function.
Internally, the ART-C procedure concatenates the variables specified
in term
, and then removes the originals. When specifying the effect
terms on which to conduct contrasts, use the concatenation of the effects
specified in term
instead of the original variables. This is demonstrated
in the example below.
An object of class lm
if formula(m)
does not
contain grouping or error terms, an object of class merMod
(i.e. a model fit by lmer
) if it does contain grouping terms, or
an object of class aovlist
(i.e. a model fit by aov
)
if it contains error terms.
Lisa A. Elkin
Elkin, L. A., Kay, M, Higgins, J. J., and Wobbrock, J. O. (2021). An aligned rank transform procedure for multifactor contrast tests. Proceedings of the ACM Symposium on User Interface Software and Technology (UIST '21). Virtual Event (October 10–14, 2021). New York: ACM Press, pp. 754–768. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/3472749.3474784")}
See also art.con
, which makes use of this function.
data(Higgins1990Table5, package = "ARTool")
## create an art model
m <- art(DryMatter ~ Moisture*Fertilizer + (1|Tray), data=Higgins1990Table5)
## use emmeans to conduct pairwise contrasts on "Moisture"
library(emmeans)
contrast(emmeans(artlm.con(m, "Moisture"), ~ Moisture), method = "pairwise")
## use emmeans to conduct pairwise contrasts on "Moisture:Fertilizer"
## N.B. internally, artlm.con concatenates the factors Moisture and Fertilizer
## to create MoistureFertilizer. If you try to use any of Moisture, Fertilizer,
## Moisture:Fertilizer, or Moisture*Fertilizer in the RHS of the formula
## passed to emmeans, you will get an error because the factors Moisture and Fertilizer
## do not exist in the model returned by artlm.con.
contrast(emmeans(artlm.con(m, "Moisture:Fertilizer"), ~ MoistureFertilizer), method = "pairwise")
## Note: art.con uses emmeans internally, and the above examples are equivalent to
## the following calls to art.con, which is the recommended approach as it will
## ensure the model selected and the contrasts extracted from emmeans match.
art.con(m, "Moisture")
art.con(m, "Moisture:Fertilizer")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.