# Questions tagged [brms]

brms is an R package interfacing stan for Bayesian analysis

58 questions
Filter by
Sorted by
Tagged with
1 vote
87 views
+50

### How to Compute Mean Ratios and Their 95% Confidence Intervals in a Bayesian Model

I am working on a Bayesian model using the brm function from the brms package in R, and I am interested in comparing mean responses of different groups. Specifically, I would like to calculate the ...
25 views

### Proper analysis of completely crossed design with subjects and items as random effects (brms)

I have the following study design: stimuli: 240 pictures: 6 pictures of 40 students each (each student fixated one of six points and during each fixation one picture was taken) each stimulus was ...
30 views

### For mixed effects model with multiple random intercepts, are bayesian approaches (with MCMC) more robust than frequentist?

I stumbled upon this particular webpage from UCLA containing the following text: [...] Inference from GLMMs is complicated. Except for cases where there are many observations at each level (...
24 views

### Calculating percentage change from emmeans

A related question was asked on this thread How to calculate percentage difference of geometric means with emmeans?, but I still need some help. Instead of calculating the absolute difference between ...
1 vote
15 views

### Incorporating neighboring years in multilevel model, estimated in Stan using brms

I am estimating a multilevel model in Stan, using the brms package. Specifically, I am estimating a model of the following form: m1 <- brm(y ~ 1 + (1 | year)) ...
103 views

### Is it possible to use smooth functions as part of a nonlinear regression?

Background I am fitting nonlinear regressions with a single response and two predictors. I know the relationship between the response and each of the predictors, but I do not know how they interact. I ...
32 views

### Why do you always need to interact the covariates with the slope in mutlilevel models?

On a number of occassions, I have seen people remark that you should always interact your covariates with the with your slope when running multilevel models. That is, for example, you should not run ...
1 vote
21 views

### Sourcing Informative Priors from an already conducted Empirical Study in brms package in R

I am conducting two studies (with 15 participants) and my study is based on two already conducted studies with a very similar objective and method. One of the studies contain only the results, and one ...
1 vote
33 views

### (Bayesian) meta-analysis for circular-linear correlation

I am working on a meta-analysis exploring the relationship between sleep and memory. In one session, I am interested in conducting an analysis on the circular-linear correlation between a circular ...
18 views

### Access to the interaction of two three level factors on a mixed model

Using a mixed model (either frequentist lmer or bayesian brms) I have an issue regarding an interaction in my model. I have two factor variable of three level : condition (0-1-2) and Tps_real (0-300-...
11 views

### Mixed-effects model when the response has two distinct distributions for two levels of an explanatory factor

I have a continuous response variable called "distance," which was measured in two different years (2019, 2020), and each year exhibited a significantly different distribution. In 2019, the ...
18 views

### Comparing ICCs between logistic and linear mixed-effects models

I have a (Bayesian) logistic mixed-effects model and a linear one, both fitted with brms. Both are fitted on data from human subjects that account for repetition, therefore, I have included a subject ...
1 vote
28 views

### Bounded uniform prior in R

I have been fitting a bayesian GLM using brms. The code works well but when I loop this over several data and make it a bit more complex, R encounters a fatal error and crashes. This seems to be ...
37 views

### Non-linear formulas in mgcv

in brms (which is heavily based on mgcv) there is a possibility to define non-linear formulas (meaning not linear in parameters). However, for different reasons I need to use mgcv. E.g. the model <...
1 vote
26 views

### Measuring uncertainty in edge weights using Bayesian modeling and brms in R

I'm interested in using Bayesian models to measure uncertainty in edge weights within social networks. Specifically, I have been trying to replicate how this package works but using brms: https://...
154 views

### brms model specification with 3 (crossed or nested?) levels

I have a data set that looks like this toy data ...
1 vote
148 views

### Is it possible to specify a nested autocorrelation term when working with a hierarchical structure (GAM)?

I am modelling the occurrence of a species at 5 different sites on an hourly basis (presence/absence), based on a range of temporal predictors (e.g. time of the year, day/night cycle, tides ...). ...
28 views

### Title: How to fit a Frequentist Equivalent of Bayesian mixed-effects model with nlme or lme4 and obtain category-specific variances and intercepts?

I am interested in fitting a Bayesian mixed-effects model to my data using the brms package. My data includes three grouping variables (Category, BioRep, and TechRep), and I want to estimate category-...
1 vote
71 views

### bayesian problem using inverse gamma: negative initial values

My study involves a dependent variable measuring reading times (minimum value = 0.3) and two categorical variables (y = "quick" or "slow"; t = "cute" or "ugly") ...
112 views

### How to interpret elpd_diff of Bayesian LOO estimate in Bayesian Logistic Regression

I have conducted a Bayesian Logistic regression, and I would like to compare 2 models : one model with one continuous predictor (M1) and one model without predictor (M0). The outcome is a binary ...
100 views

### brms: Problem with the scale in model specification

First of all I apologize as some might see this a stupid question, but I cannot manage to find the answer. I am using brms package in R. I have two models, an ...
64 views

### Negative bayes factor and how to fix it

I am currently trying to calculate bayes factor for eye tracking study. I created linear mixed-effect model and found best random factor structure using buildmer. On there, p value for the main effect ...
25 views

### Significant t-value but bayes factor showing favour towards null

I am currently trying to build linear mixed-effect model to compare continuous dependent variables between categorical independent variables (like conducting ANOVA), but with random factors (to remove ...
120 views

### Interpreting Output of Bayesian Regression Modeling in R

I'm trying to find out if the metaphor and political affiliation influences the response category, and if the vignette length influences the reported reliability I used this code: ...
171 views

### brms: obtaining the coefficients of the conditional mean in a non-linear model

I'm using brms to fit a non-linear model to a set of data representing biexponential decay ($y_i = a_1 \cdot e^{-k_1\cdot x_i}+a_2 \cdot e^{-k_2\cdot x_i}$). It seems that the parameter estimates ...
38 views

### How to extract Bayesian evidence for model with interaction term versus without interaction term

I want to extract evidence for the null in a training study (e.g. following these guidelines: https://www.frontiersin.org/articles/10.3389/fpsyg.2014.00781/full). The training effect would be ...
1 vote
86 views

### How to specify a formula for a multilevel GAM with multiple categorical factors?

I have a complex dataset on elite alpine ski racers that learn to pump to increase velocity in slalom. On the pre-test and post-test, we placed a local positioning unit on each skier to explore the ...
318 views

### Can I set my priors to the get_priors outcome (brms package) in a linear mixed effect model?

I am brand new to Bayesian statistics. I want to perform a linear mixed effect model via the brms package in R. To do that, I have to set priors in my model fit. I ...
162 views

### Is there a difference between hierarchical GAM (HGAM) and Mixed effect GAM (GAMM)?

What is the difference between Hierarchical GAMs (HGAM) and Mixed GAMs (GAMM), if any? I am looking to model time series of count data against a range of candidate explanatory variables (hoping to ...
1 vote
35 views

### Can BRMS do factored regression for missing data? [closed]

I see within the Github that SEM and latent variable modeling is possible, but wondering if anyone has done any factored regression? Or is this still Blimp/Mplus territory?
262 views

### Allowing interaction of smooth by categorical predictor to vary across levels of random effect

I am trying to figure out the correct specification of random effects (specifically an interaction varying across levels of a random effect) when moving from a linear mixed model to a GAMM. I am ...
34 views

### How to jointly model a binary outcome with an associated confidence rating using R?

I have data of the form: judgment confidence variable A 0.4 2 A 0.7 1 A 0.8 5 B 0.2 4 B 0.6 6 B 0.1 8 Outcomes: A dichotomous variable (binary judgment) A confidence score associated with the ...
67 views

### How are repeating dependent variable in long-data format affect outcomes in mixed effects linear regression models [closed]

My question is about the mixed effects linear regression analysis (i.e. lme4 or brms libraries in R) using long data format in R. How does brms analyze the data where the dependent variable repeats ...
1 vote
44 views

### How to interpret coefficents when you have an offset?

I'm measuring counts of birds as a function of the time (in months) across three parks (NP), as well as the presence of carcasses and season. I'm trying to find out whether the population is ...
502 views

### Calculating odds ratios and respective confidence intervals for multilevel multinomial logistic regression using brm package

I am predicting a 4 category variable using a multinomial regression and allowing intercepts to vary by country. Is there a way to calculate odds ratios and their confidence intervals for each ...
195 views

### How to improve model's predictive accuracy brms / rstan

General question: How can you improve a model after seeing that it poorly predicts your data (i.e. posterior predictive distribution doesn't recover your data well)? I am fitting a multilevel beta ...
860 views

### Does brms automatically standardise data and/or coefficients?

I'm running some regression models in R using brms and lme4. When I run a Bayesian model: ...
866 views

### How can I sample from a shifted and scaled Student-t distribution with a specified mean and sd in R?

I'm currently building some Bayesian models with the brms package and the default intercept prior is student_t(3, 0, 6.3) and so ...
1 vote
34 views

### Interaction between two factors as Random effects in mixed model in R

I would like to know how to write random effects of two interacting factors. For example, I have 6 species which were planted in 48 plots and replicated in two blocks. There are in total 48 ...
1 vote
285 views

### How to interpret the evidence ratio using BRMS in R?

I am running a frequentist multi-level meta-analysis. However a reviewer has requested a bayesian alternative, so I can provide Bayes Factors. My summary of my code is as follows: ...
1 vote
182 views

### Hierachical Bayesian modelling using brms: how to insert a prior that reflects cut-offs of Reaction Times distribution?

I am running a hierarchical Bayesian model using brms on reaction times (RTs) of a GoNogo task. The predictors are categorical and include the 3 stimuli/condition that participants observed and the 2 ...
1 vote
95 views

### Bayesian GLM where the response variable is count classes

Description of data I have to analyze some data where the response variable is the counts of number of insects observed feeding on a bait at many time points. The treatments are three different types ...
52 views

### Can I Use the loo function to help me choose between a Poisson and Bernouilli distribution in bayesian

I have two models exactly similar, but I’m using a Poisson distribution for one and a Bernoulli distribution for the other. Can I trust the information coming out of loo to help me choose? The ...
1 vote
235 views

### fitting multilevel models for data that is both multiple membership and repeated measures

I have a longitudinal dataset with 5 repeated measures, where individuals are nested within counties and may have moved to a new county during the study period, e.g., ...
24 views

### Analysing repeated movement trajectories - is a GP the right approach?

I have some data where I have multiple conditions per subject (humans, in this case), who made repeated movements under these conditions. I'm interested in the variability of these movements. The data ...
310 views

### Help in understanding zero inflated neg binomial model summary

I'm writing this topic because I would need to get some more information about model conversion in brms (zero-inflated_negbinomial) model. Let's say I have this model result : Where I want to model ...
332 views

### Difference in fitting to right censored data between MLE and Bayesian method

I am fitting a Weibull curve to right censored data. I am doing it by general MLE method using Survival::survreg() as well as Bayesian method using brms::brm. I am pretty sure that I am getting the ...
180 views

### missing data with longitudinal data

I have some longitudinal data that I want to model using multilevel modeling in brms. I have two time points. I have missing values on the second time point of the outcome. But otherwise complete data....