Learn R Programming

spaMM (version 4.6.1)

post-fit: Applying post-fit procedures from other packages on spaMM results

Description

Packages implementing post-fit procedures define helper functions which may not handle spaMM's fit objects, or which have not always handled them, or which can handle them correctly only with some non-default arguments. This documentation topic gives further directions to apply some such post-fit procedures (from packages DHARMa, RLRsim, multcomp and lmerTest) to these fit objects.

emmeans can be tentatively applied to spaMM's fit objects but the underlying code is experimental. It may be safer to use multcomp::glht.

For other procedures not considered here, diagnosing a failure in a debugging session may suggest a simple solution (as it did for multcomp::glht).

Arguments

Details

For multiple comparison procedures by multcomp::glht, one has to explicitly give the argument coef.=fixef.HLfit (see Examples; fixef.HLfit is the spaMM method for the generic function fixef);

For DHARMa plots, see Details of plot.HLfit;

For using RLRsim::RLRTSim(), see get_RLRTSim_args.

For using lmerTest::contest() or lmerTest::anova(), see as_LMLT.

Examples

Run this code
if (requireNamespace("multcomp", quietly = TRUE)) {
  library(multcomp)
  set.seed(123)
  irisr <- cbind(iris,id=sample(4,replace=TRUE,size=nrow(iris)))
  irisfit <- fitme(Petal.Length~ Species +(1|id), data=irisr, family=Gamma(log))
  summary(glht(irisfit,mcp("Species" = "Tukey"), coef.=fixef.HLfit))
}

Run the code above in your browser using DataLab