Skip to main content

Questions tagged [brms]

brms is an R package interfacing stan for Bayesian analysis

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How to use posterior predictions from one model (standard curve) as an outcome variable in another model?

I'm working with a dataset concerning the concentration of a large number of different chemical compounds in a mixture, using a Bayesian approach (with brms in R). The instrument that measures the ...
Jacob Weverka's user avatar
4 votes
3 answers
111 views

How to fit a Bayesian model to a mixture of Beta and One-Zero inflated data?

I have very noisy data, which I believe is created through interactions of multiple physical processes. In the mapping $Y = f(X),$ $Y$ is a ratio $[0, 1]$ and $X \ge 0.$ While $Y$ is a function of $X,$...
PPR's user avatar
  • 101
0 votes
0 answers
28 views

post-hoc test for multinomial logistic regression brm model (categorical response)

I apologise as I am very new to this package and I really appreciate any help I can get. I have a brms model with a categorical response variable (Species) with the ...
user avatar
3 votes
1 answer
56 views

The default covariance structure implicitly assumed in the brms formula

Background: The brms official page provides the following example code to illustrate the usage of the package: ...
Hirofumi Shiba's user avatar
0 votes
0 answers
19 views

Estimating markov transition matrix using total elevator "ups" and "downs" by floor

I have data on elevator presses and I am hoping to use them to estimate a Markov transition matrix, so I can ultimately estimate how frequently people go to different floors. For each floor from 1-4, ...
Jon Spring's user avatar
1 vote
0 answers
26 views

Inconsistent posterior from hierarchical survival model

I asked about this question on Stan forum but no one replied so dual posting here. I'd really appreciate some insight, as I'm completely stuck. I’m trying to do hierarchical survival modeling using ...
Ville's user avatar
  • 81
2 votes
1 answer
43 views

Calculating contrasts of marginal effects with marginaleffects for brms model

I have fitted a logistic model with brms and want to calculate the average marginal effects (AMEs). ...
Tester01's user avatar
0 votes
1 answer
31 views

Interaction: Posterior comparison brms, difference between as_draws, and posterior_predict. Is it correct to interpret posterior_predict instead?

I have an interaction effect in my model, and I want to extract the posterior of each of my parameter in order to compare them and make inference about them. I couldn't simply use the as_draws() ...
Guillaume Pech's user avatar
0 votes
0 answers
23 views

Likert scale study - ordinal regression model

My linguistics rating experiment contains 36 stimuli in total for rating. There are 6 themes (e.g. doctor, farm, etc), and each theme has 3 conditions (good, bad, mixed), and each condition has 2 ...
user avatar
4 votes
1 answer
349 views

Setting priors for categorical variables in bayesian multilevel model analysis with BRMS package (repost)

I am reposting the same question that I made on Stack Overflow. I am new with Bayesian analysis methods and I am still struggling understanding some concepts regarding priors. I am running a model ...
Dea's user avatar
  • 41
0 votes
0 answers
25 views

Include error on the predictor from mean and asymetric credible interval

I am doing non-linear models with brms. My model is : ...
user avatar
0 votes
0 answers
21 views

How to select a proper prior to control the time dependent structure of variable?

I am new in analyzing RCT data and not familiar with the techniques that are always used in RCT analysis. I am analyzing a dataset of a study: An RCT study with 50 participants; the data was collected ...
doraemon's user avatar
  • 250
0 votes
0 answers
32 views

Results dirichlet regression - brms vs DirichelReg comparison

I am new to Dirichlet regression, but I am trying to understand why model outputs are potentially different when I use two different R packages, and how I could interpret the slope and intercept ...
Vale's user avatar
  • 1
3 votes
1 answer
176 views

Bayesian linear regression: How to enforce constraint on the sum of coefficients?

I have a linear regression problem in which my $X$ matrix is not full rank. Here is a small example: $$X = \left[\begin{array}{rrrr} -1 & 0 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 &...
ischmidt20's user avatar
1 vote
0 answers
62 views

How to improve bayesian logistic regression model with priors

I'm trying to fit a bayesian logistic regression model to calculate the expected goals (xG) of certain shootings data in football. My model has some simple features where I first fit a model with ...
Quinten's user avatar
  • 389
1 vote
0 answers
30 views

Is it possible to estimate effects using Bayesian modelling after matching?

I am following [Greifer 2023][1] to estimate the effect size after (genetic) matching, where I am using bootstrapping to estimate the confidence intervals. Since I have a hierarchical setup with ...
guest1927's user avatar
0 votes
1 answer
135 views

Interpreting Coefficients of brms Bernoulli family model

I am struggling with interpreting model results from a brm() model. The first result uses scaled and centered data with command scale(df$column, scale = TRUE, center = TRUE). ...
user avatar
1 vote
1 answer
247 views

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
1 vote
0 answers
39 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
38 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
1 vote
1 answer
121 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
  • 11
1 vote
2 answers
31 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
142 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
  • 19k
0 votes
1 answer
41 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
29 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
0 votes
1 answer
30 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
15 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
1 vote
0 answers
86 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
71 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
35 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
486 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
2 votes
1 answer
365 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
  • 309
0 votes
1 answer
54 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
107 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
  • 321
3 votes
1 answer
603 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
138 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
104 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
26 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
213 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
1 vote
1 answer
350 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
1 vote
0 answers
434 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
  • 528
4 votes
1 answer
276 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
  • 309
1 vote
0 answers
41 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
2 votes
1 answer
428 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
64 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
70 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
  • 1,021
0 votes
0 answers
636 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
1 vote
1 answer
264 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
  • 11
3 votes
1 answer
1k 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