Contents
How to use BRMs for Bayesian GLM in R?
This tutorial provides an introduction to Bayesian GLM (genearlised linear models) with non-informative priors using the brms package in R.
How to create a generalised linear model with BRMs?
1. Preparation; 2. Introduction to GLM; 3. Thai Educational Data; 4. Data Preparation; 5. Bayesian Binary (Bernoulli) Logistic Regression; 6. Bayesian Binomial Logistic Regression; 7. Bayesian Multilevel Logistic Regression.
How to use Bayesian logistic regression in multilevel analysis?
The current tutorial specifically focuses on the use of Bayesian logistic regression in both binary-outcome and count/porportion-outcome scenarios, and the respective approaches to model evaluation. The tutorial uses the Thai Educational Data example in Chapter 6 of the book Multilevel analysis: Techniques and applications.
What are the arguments of the BRM function?
The brm function from the brms package performs Bayesian GLM. The brm has three basic arguments that are identical to those of the glm function: formula, family and data. However, note that in the family argument, we need to specify bernoulli (rather than binomial) for a binary logistic regression.
How to calculate the phylogenetic signal with BRMs?
For each parameter, Bulk_ESS and Tail_ESS are effective sample size measures, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat = 1). The so called phylogenetic signal (often symbolize by λ) can be computed with the hypothesis method and is roughly λ = 0.7 for this example.
How are non linear smooth terms modeled in BRMs?
Flexible non-linear smooth terms can modeled using the s and t2 functions in the pterms part of the model formula. This allows to fit generalized additive mixed models (GAMMs) with brms. The implementation is similar to that used in the gamm4 package. For more details on this model class see gam and gamm .
How are Gaussian processes used in BRMs formula?
Gaussian process terms can be fitted using the gp function in the pterms part of the model formula. Similar to smooth terms, Gaussian processes can be used to model complex non-linear relationships, for instance temporal or spatial autocorrelation.