Dispatches each type to the model it is valid on. The VPC and shrinkage
views ("vpc", "obs_vs_shrunken", "predicted") use the
null model by default; for type = "vpc" the model argument
selects the null model, the adjusted model, or "both" – one combined plot
that shows the null-to-adjusted change with the PCV annotated. The
additive-vs-intersectional views ("effect_decomp",
"prediction_deviation") use the
adjusted model, whose fixed effects carry the dimensions' additive part so
the stratum random effect is the pure interaction; with fewer than two dimensions
(no adjusted model) they fall back to the null model. Group types
("group_vpc", "group_components", "group_between_variance",
"group_pcv", "group_additive_share") use the group comparison when
maihda was called with a group.
Usage
# S3 method for class 'maihda_analysis'
plot(
x,
type = "all",
highlight_interactions = FALSE,
only_flagged = FALSE,
highlight_by = c("flag", "rope"),
rope = NULL,
select = c("order", "deviation"),
order_by = c("predicted_desc", "stratum", "predicted_asc", "deviation"),
model = c("null", "adjusted", "both"),
...
)Arguments
- x
A
maihda_analysisobject frommaihda.- type
One of the model types ("all", "vpc", "obs_vs_shrunken", "predicted", "upset" (the UpSet-style alternative to "predicted"; forwards
quantityvia...), "effect_decomp", "prediction_deviation"), the contextual type ("context_vpc", a stratum-vs-context variance bar; requiresmaihda(context = )), a longitudinal type ("vpc_trajectory", "trajectories", "pcv_trajectory"; requiresdecomposition = "longitudinal"), or a group type ("group_vpc", "group_components", "group_between_variance", "group_pcv", "group_additive_share"). Default "all". For a longitudinal analysis "all" shows the VPC-over-time, the stratum trajectories, and the time-specific PCV.- highlight_interactions
Highlight strata with a credibly non-zero intersectional interaction on the BLUP-based views (see
maihda_interactionsandplot).FALSE(default),TRUE(computed from this analysis's adjusted / crossed-dimensions model), a multiple-testing method such as"BH", or amaihda_interactionsobject. The flags are computed once from the correct (adjusted) model and reused across views.- only_flagged
Show only the highlighted strata on the
"predicted"and"obs_vs_shrunken"views instead of dimming the rest (seeplot).FALSE(default) keeps every stratum;TRUErestricts those views to the highlighted strata (those carrying a credibly non-zero interaction, or – underhighlight_by = "rope"– those classified ROPE-"relevant") and, whenhighlight_interactionsis leftFALSE, turns the highlight on with this analysis's stored diagnostic."effect_decomp"ignores it (it stays highlighted in context).- highlight_by
Which interaction-screen column defines the highlighted strata:
"flag"(default, the zero-centredflaggedcolumn) or"rope"(the equivalencedecisioncolumn, highlighting the strata classified"relevant"). Seeplot."rope"requiresrope(or ahighlight_interactionsobject built with one).- rope
Equivalence region forwarded to
maihda_interactionswhen computing the screen, sohighlight_by = "rope"has adecisioncolumn to read: a single positivedfor the symmetric regionc(-d, d)on the latent (link) scale, orc(lower, upper).NULL(default) adds no equivalence classification.- select
When the
n_stratacap drops strata on the"predicted"(or longitudinal"trajectories") view, which to keep:"order"(default, first n_strata in stratum order) or"deviation"(the n_strata furthest from the reference, both tails). Seeplot.- order_by
Display order of the strata on the
"predicted"view (display-only; does not change which strata are shown, nor any value):"predicted_desc"(default) highest predicted first,"stratum"native order,"predicted_asc"lowest first, or"deviation"largest|predicted - reference|first. Seeplot.- model
For
type = "vpc", which model's variance partition to show:"null"(default) the total between-stratum heterogeneity (the previous, backward-compatible behaviour),"adjusted"the between-stratum heterogeneity remaining after the dimensions' additive main effects (closer to the pure intersectional component), or"both"– a single plot placing the two partitions together and annotating the PCV, so the null-to-adjusted change is visible in one figure. The null and adjusted single views are labelled with a"Null model"/"Adjusted model"subtitle. For a longitudinal analysis the VPC view is the time-varying VPC trajectory, and"both"overlays the null and adjusted curves. A"crossed-dimensions"analysis fits a single model (no null/adjusted pair), so only"null"is valid there;"adjusted"/"both"error.modelapplies to the VPC view only – combining a non-defaultmodelwith anothertypeis an error.- ...
Additional arguments passed to the underlying plot method.
