as.data.frame.PBmodcomp.RdConvert the test result table of a PBmodcomp or summary.PBmodcomp object
into a standard data frame for easy inspection or export.
# S3 method for class 'PBmodcomp'
as.data.frame(x, ...)
# S3 method for class 'summary_PBmodcomp'
as.data.frame(x, ...)A data.frame containing the test results with attributes preserved.
These methods extract the internal test component (a data frame of test statistics and p-values)
from the object and return it as a standard data frame. The original object's attributes are preserved
as attributes on the returned data frame.
This is useful for exporting or manipulating bootstrap test results in a tidy form.
if (FALSE) { # \dontrun{
sleepstudy$Days2 <- sleepstudy$Days^2
lmer_fit1 <- lme4::lmer(Reaction ~ Days + Days2 + (1 | Subject), data = sleepstudy, REML=FALSE)
lmer_fit0 <- update(lmer_fit1, . ~ . - Days2)
res <- pb2_modcomp(lmer_fit1, lmer_fit0, nsim = 200)
df <- as.data.frame(res)
head(df)
s <- summary(res)
as.data.frame(s)
} # }
## @seealso \code{\link{pb2_modcomp}}, \code{\link{summary.PBmodcomp}}