Remove "title" from plot.brmshypothesis

Hi Forum,

Does anyone know a way to remove the “title” from plot.brmshypothesis?

For example:

plot(hyp2)

Prints the plot with the hypothesis (or a portion of it) as a title, but this object is not treated as a title by ggplot.

I have tried

plot(hyp2, chars = 0)
plot(hyp2, chars = NULL)

Which still gives a …=0 as a title

I also tried pulling it out as a ggplot object and remove the “title” using

theme(axis.title.x = element_blank()

Any assistance would be greatly appreciated!!

Jon

Code for hyp2 (taken from manual)

prior <- c(set_prior("normal(0,2)", class = "b"),
           set_prior("student_t(10,0,1)", class = "sigma"),
           set_prior("student_t(10,0,1)", class = "sd"))

## fit a linear mixed effects models
fit <- brm(time ~ age + sex + disease + (1 + age|patient),
           data = kidney, family = lognormal(),
           prior = prior, sample_prior = TRUE, 
           control = list(adapt_delta = 0.95))

h <- paste("sd_patient__Intercept^2 / (sd_patient__Intercept^2 +",
+            "sd_patient__age^2 + sigma^2) = 0")
(hyp2 <- hypothesis(fit, h, class = NULL))

Please also provide the following information in addition to your question:

  • Operating System: osx 10.11
  • brms Version: 2.4.4

It’s not a normal title, it’s facet title. Not sure how to get rid of that. The easiest way is perhaps to just create the plots yourself based on the output of hypothesis. In your case, see str(hyp2) for how the internals look like.

Ok, thanks Paul! I’ll try out that method.

plot(hyp) is a list of ggplot objects. To remove facet labels from hypothesis object hyp's first element, you can use

plot(hyp)[[1]] + 
  theme(strip.text = element_blank())