fabiob
fabiob

Reputation: 295

How to use the papaja R package for glht output?

Following the instructions, I came up with the following:

library(papaja)
library(datasets)
library(stats)
library(multcomp)


bla <- glm('MPG.highway ~ DriveTrain*Origin',data = Cars93)
contrast.matrix <- rbind('main' = c(0,1,0,0,0.5,0), 'int' = c(0,0,0,0,1,0))
blac <-  glht(bla, linfct = contrast.matrix)
apa_print.glht(blac,test = multcomp::adjusted())
apa_print.summary.glht(summary(blac,test=adjusted(type="bonferroni")))

that does not work: "Can't subset columns that don't exist. x Column p.value doesn't exist."

Any better ideas? Or since the package is experimental it does not work at all yet? Tips on how to print the output of glht to an htlm document produced by knitr are also accepted.

Upvotes: 2

Views: 201

Answers (2)

crsh
crsh

Reputation: 1716

The documentation of apa_print.glht() notes

These methods are not properly tested and should be considered experimental.

It seems that there have been some upstream changes that caused this method to fail. Sorry about that, but it should now be fixed. Please trying installing the latest development version of papaja :

remotes::install_github("crsh/papaja@devel")

apa_print(blac,test = multcomp::adjusted())

Upvotes: 2

Lukas
Lukas

Reputation: 11

After installing the last devel. version of papaja, and running apa_print with an "emmeans" object, the same error occures in my case as well:

<error/vctrs_error_subscript_oob>

Error: Can't subset columns that don't exist. x Column p.value doesn't exist.

Upvotes: -1

Related Questions