NA evidence ratios for hypothesis tests in

  • Operating System: Linux
  • brms Version: version 2.8.0

The help page provides an example of hypothesis for all levels of a grouping factor:

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))


## compute hypotheses for all levels of a grouping factor
hypothesis(fit, "age = 0", scope = "coef", group = "patient")

Hypothesis Tests for class :
   Group Hypothesis Estimate Est.Error CI.Lower CI.Upper Evid.Ratio Post.Prob Star
1      1  (age) = 0    -0.01      0.02    -0.04     0.03         NA        NA     
2      2  (age) = 0    -0.01      0.02    -0.05     0.03         NA        NA     
3      3  (age) = 0    -0.01      0.02    -0.04     0.03         NA        NA     
4      4  (age) = 0     0.00      0.02    -0.04     0.03         NA        NA     
5      5  (age) = 0    -0.01      0.02    -0.04     0.03         NA        NA     
6      6  (age) = 0    -0.01      0.02    -0.04     0.03         NA        NA     
7      7  (age) = 0    -0.01      0.02    -0.04     0.03         NA        NA     

etc

I have a similar model and would like to be able to get evidence ratios for each level of the grouping factor. What am I missing?

Thanks

This is dicussed in the details section of ?hypothesis.

Hi,
Thanks for responding. Not sure I’m what I’m missing here - are you referring to “all parameters related to the hypothesis must have proper priors and argument sample_prior of function brm must be set to TRUE”. If so, what is missing from the example above - where is an improper prior sneaking in?

                  prior     class       coef   group resp dpar nlpar bound
1           normal(0,2)         b                                         
2                               b        age                              
3                               b  diseaseAN                              
4                               b  diseaseGN                              
5                               b diseasePKD                              
6                               b  sexfemale                              
7   student_t(3, 4, 10) Intercept                                         
8  lkj_corr_cholesky(1)         L                                         
9                               L            patient                      
10    student_t(10,0,1)        sd                                         
11                             sd            patient                      
12                             sd        age patient                      
13                             sd  Intercept patient                      
14    student_t(10,0,1)     sigma                            

is lkj_corr_cholesky improper?

Ah, I now see the problem. We do not sample from the hierarcical priors of the random effects for technical reasons, so basically you won’t be able to obtain a point Bayes factor (aka evidence ratio for a “=” hypothesis) when using scope “coef” or “ranef”. I will update the documentation to reflect this.

Is that also the case for one sided priors?

What do you mean by one-sided priors?

Sorry, one sided hypotheses, ie > 0 rather than = 0.

For one-sided comparisons, sampling from priors is not needed and thus we will always get an evidence ratio and posterior probability.