Questions tagged [brms]

brms is an R package interfacing stan for Bayesian analysis

Filter by
Sorted by
Tagged with
1 vote
1 answer
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 ...
mat's user avatar
  • 561
0 votes
0 answers
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 ...
Coconutts's user avatar
0 votes
0 answers
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 (...
user395154's user avatar
0 votes
1 answer
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 ...
mrmic1's user avatar
  • 1
1 vote
1 answer
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)) ...
user2018396's user avatar
4 votes
1 answer
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 ...
mkt's user avatar
  • 17.2k
0 votes
1 answer
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 ...
statslearner13's user avatar
1 vote
0 answers
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 ...
Deepshikha Prasad's user avatar
1 vote
0 answers
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 ...
Thea Ng's user avatar
  • 11
0 votes
1 answer
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-...
Guillaume Pech's user avatar
0 votes
0 answers
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 ...
user7618183's user avatar
0 votes
0 answers
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 ...
Tester01's user avatar
1 vote
0 answers
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 ...
blackandwhite's user avatar
0 votes
1 answer
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 <...
Niklas's user avatar
  • 1
1 vote
0 answers
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://...
Peej's user avatar
  • 11
2 votes
1 answer
154 views

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

I have a data set that looks like this toy data ...
lilla's user avatar
  • 23
1 vote
1 answer
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 ...). ...
Timelate's user avatar
  • 249
0 votes
1 answer
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-...
Dermot Harnett's user avatar
1 vote
0 answers
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") ...
Olivia's user avatar
  • 101
0 votes
0 answers
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 ...
user381165's user avatar
0 votes
1 answer
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 ...
Unai Vicente's user avatar
0 votes
0 answers
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 ...
Chicake's user avatar
0 votes
0 answers
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 ...
Chicake's user avatar
0 votes
0 answers
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: ...
Miriam's user avatar
  • 1
0 votes
1 answer
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 ...
Peder Holman's user avatar
0 votes
0 answers
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 ...
Clarius333's user avatar
1 vote
0 answers
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 ...
Cmagelssen's user avatar
0 votes
0 answers
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 ...
Thomas's user avatar
  • 468
4 votes
1 answer
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 ...
Timelate's user avatar
  • 249
1 vote
0 answers
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?
SCDCE's user avatar
  • 111
0 votes
1 answer
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 ...
Angelos Amyntas's user avatar
0 votes
0 answers
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 ...
Dominique Makowski's user avatar
3 votes
0 answers
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 ...
Jade22's user avatar
  • 31
1 vote
0 answers
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 ...
adkane's user avatar
  • 901
0 votes
0 answers
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 ...
EML's user avatar
  • 101
0 votes
1 answer
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 ...
Will's user avatar
  • 1
2 votes
1 answer
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: ...
codegoblin1996's user avatar
4 votes
2 answers
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 ...
timnus's user avatar
  • 53
1 vote
0 answers
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 ...
Tanvir Shovon's user avatar
1 vote
0 answers
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: ...
Ajj1988's user avatar
  • 51
1 vote
0 answers
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 ...
TomC's user avatar
  • 21
1 vote
1 answer
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 ...
qdread's user avatar
  • 205
2 votes
1 answer
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 ...
mountaingoat19's user avatar
1 vote
0 answers
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., ...
epigurl's user avatar
  • 11
0 votes
0 answers
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 ...
janfreyberg's user avatar
4 votes
1 answer
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 ...
chippycentra's user avatar
2 votes
1 answer
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 ...
PitPartizan's user avatar
0 votes
1 answer
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....
user20334's user avatar
0 votes
1 answer
29 views

Interpolating curve equation from model data

I need to define an equation to represent a series of points from a model. As they are predictions from an already fit non-linear regression, noise shouldn't really be an issue. I have seen many ...
Kai P's user avatar
  • 11
1 vote
0 answers
140 views

Interpreting non linear brms output - estimates of posterior cooefficient and user supplied formula

I am a bit confused about how to approximate the equation from a nonlinear model constructed in brms, and was hoping someone could explain it to me. Say I have the below model: ...
Kai P's user avatar
  • 11