Repository navigation
Changes
-
The Linearity and Homogeneity of Variance panels of
check_model()(and the
plot ofcheck_heteroscedasticity()) now draw the mean of each cell, joined
by a line, in place of the LOESS smoother when the fitted values take only
a few distinct values, for example in models with only categorical
predictors. A LOESS fit over so few values warned and could bend far
outside the data. Whenshow_ciisTRUE, the cell means get 95% error
bars. Note that performance currently turnsshow_cioff for models
whose terms are all factors without interactions (#464). -
plot()forcheck_model()andcheck_heteroscedasticity()gains a
show_smoothargument. Withshow_smooth = FALSE, the Linearity and
Homogeneity of Variance panels draw neither the LOESS smoother nor the cell
means, the Influential Observations panel draws no LOESS smoother, and the
subtitles of the Linearity and Homogeneity of Variance panels no longer refer
to a reference line (#464). -
plot()fordatawizard::means_by_group()gets aflipargument. Use
flip = FALSEto show the groups on the horizontal axis (#455). -
geom_violinhalf()andgeom_violindot()are now drawn with the ggdist
package (ggdist::stat_slab()andggdist::geom_dots()), which they now
need (version 3.3.3 or later). They work with facets and free scales (#81,
#385), and the plots look a little different. Dodged groups each take half
of their dodge cell, from its centre, as before. The dots of
geom_violindot()were not dodged before. By default, they now go in the
other half of the cell (they overlap a flipped half violin). The newintervalargument
adds the median with 66% and 95% intervals (#68). Thebinwidthdefault of
geom_violindot()is nowNA(it was 0.05), so ggdist sizes the dots to
the data (#44). Other arguments in...ofgeom_violindot()now go to
ggdist::geom_dots()(instead ofgeom_dotplot()) as well as to the half
violins, except the arguments of the density, the layout, and the interval,
which go to the half violins only (see?geom_violindot). Awidthin...
is the width of a whole violin, as ingeom_violin(), so each half violin
is half as wide.boundsmust contain all values; otherwise the half
violins are not drawn. Thestatargument is now ignored, with a warning
for any value other than"ydensity"orggplot2::StatYdensity.
geom_violindot()no longer works withcoord_polar(). -
plot()formodelbased::estimate_contrasts()now draws joint contrasts of
two or more variables, such ascontrast = c("am", "cyl"). The x axis shows
the combinations of levels, such as "auto, 4". -
plot()formodelbased::estimate_contrasts()gains ashow_dataargument.
Withshow_data = TRUE, the plot draws the raw data of the model as jittered
points behind the lighthouses (easystats/modelbased#114). -
plot()formodelbased::estimate_contrasts()now draws more kinds of
estimates. It draws means in aProbability,Proportion, orRatecolumn,
such as the probabilities of a logistic model. It draws ratio contrasts from
comparison = ratio ~ pairwiseas ratios of the means. With the default
backend, it draws contrasts of a log response estimated with
transform = TRUEas ratios of the back-transformed means. The plot stops
with an error for contrasts back-transformed from some other
transformations, such assqrt(y). Wheninsight::find_transformation()
reports a transformation other than"identity", it also stops for ratio
contrasts estimated withtransform = TRUE. It also stops for contrasts and
means on different scales, as theirpredictortransformarguments
show. The help page lists the exceptions. Withshow_data = TRUE, the plot
draws a logical or two-level factor response as 0 and 1. It also draws the
raw data ofyfor a responselog(y),log2(y), orlog10(y). This needs
contrasts and means estimated withtransform = TRUE. -
plot()formodelbased::estimate_contrasts()now draws ordinal and
multinomial models, such asMASS::polr()andmclogit::mblogit(), with one
panel per response category. Each panel shows the probabilities of that
category and the contrasts within it. Contrasts between two categories are
not drawn.show_data = TRUEstops with an error for these models. The plot
also draws Bayesian ratio contrasts fromcomparison = ratio ~ pairwiseas
ratios. Wheninsight::find_transformation()reports"identity", it draws
ratio contrasts estimated withtransform = TRUEas ratios. It accepts
contrasts and means on the link scale from the marginaleffects and emmeans
backends together. For some models, such aslm(y ~ x), the link scale
counts as the response scale. These models have an identity link, and
insight::find_transformation()reports their response as"identity".
The link scale does not count for a model with a zero-inflation or hurdle
part. -
plot()formodelbased::estimate_contrasts()now shows only the panels
of thebylevels that the contrasts have. It leaves out the means and
raw data of other levels. A numeric contrast variable at unevenly spaced
values, such ascontrast = "wt=c(2,2.5,4)", gets a continuous x axis
that keeps their spacing. Joint contrasts of three or more
variables show one level per line in the axis labels. Abyvariable
namedPANEL,ROW,COL,SCALE_X, orSCALE_Yno longer stops the
plot. -
If a term with a VIF below 2 has an upper confidence limit that is infinite
or above the top of the plot, the collinearity plot now has a caption. The
caption says that the interval formula (from performance) fails near
VIF = 1, and that this is not high collinearity. This applies toplot()
forcheck_collinearity()and to the collinearity panel ofcheck_model().
The y axis now extends below VIF = 1, so the axis no longer cuts off points
at 1 (#399).
Bug fixes
-
plot()for structural equation models fromparameters::model_parameters()
drew latent factors as observed variables and indicators as latent
variables. Latent factors are now drawn as circles and indicators as
squares. -
plot()for structural equation models now gives an informative error
when the selectedcomponenthas no paths to plot, for example
component = "regression"for a confirmatory factor analysis (#243). -
geom_binomdensity()now works with facets. It no longer drops the
columns other thanxandy, so each panel shows only its own data
(#192). -
When
check_model()failed to create plots, the informative message
about troubleshooting and workarounds was no longer printed. This should
now work again. -
plot()formodelbased::estimate_contrasts()now draws each contrast
estimated withbyfrom the means of its ownbylevel. Previously, it mixed
the means of allbylevels into each contrast. If the means listed theby
variable first, it drew no contrasts. The plot now shows one panel per level,
or combination of levels, of thebyvariables. The x axis now shows the
contrasted variable in the order of its levels (easystats/modelbased#267). -
When some observations had a missing Cook's distance,
plot()for
check_outliers()failed with "arguments imply differing number of rows".
An example is rows with missing values in a model fitted with
na.action = na.exclude. The scree and count plots now leave these
observations out, and the labels still name the right rows.