Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set priors when computing ordinal model #1715

Open
wenboyu0803 opened this issue Nov 29, 2024 · 0 comments
Open

How to set priors when computing ordinal model #1715

wenboyu0803 opened this issue Nov 29, 2024 · 0 comments

Comments

@wenboyu0803
Copy link

wenboyu0803 commented Nov 29, 2024

I am currently running an ordinal regression model with brms, following the guideline of Paul-Buerkner and Matti Vuorre.

here is my code with default priors:

hd.model1 <- brm(Rating ~ 1 + GAP + (1 + GAP| sub) + (1 + GAP| item),
                 data = hd,
                 init = 0,
                 family = cumulative("probit"),
                 chains = 4, 
                 warmup = 1000,
                 iter = 5000,
                 thin = 1,
                 cores = **4)**

the results of MCMC is good, and the value of beta is consistent with my assumption:

Population-Level Effects: 
             Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept[1]    -2.33      0.19    -2.70    -1.98 1.00     2318     4621
Intercept[2]    -1.40      0.17    -1.74    -1.06 1.00     2099     4323
Intercept[3]    -0.64      0.17    -0.97    -0.31 1.00     2057     4224
Intercept[4]    -0.02      0.17    -0.35     0.31 1.00     2046     4130
Intercept[5]     0.85      0.17     0.52     1.18 1.00     2094     4309
Intercept[6]     1.86      0.18     1.51     2.21 1.00     2298     4752
GAPg350Mg200    -0.12      0.14    -0.39     0.15 1.00    12602    11173
GAPg500Mg350    -0.10      0.13    -0.35     0.14 1.00    12118    11375
GAPg650Mg500     0.05      0.12    -0.19     0.28 1.00    13454    11812
GAPg800Mg650    -0.34      0.12    -0.59    -0.09 1.00    13136    11935
GAPg950Mg800    -0.07      0.13    -0.32     0.19 1.00    13810    11633

Then i want to set some priors. Related research (based on the NHST) has found that all beta values are negative and significant between 650 and 800 level. So I want to set the prior to a normal distribution with an average of -0.2 and a standard deviation of 0.5.

my code is here:

prior.1 <- c(prior(normal(-0.2, 0.5), class = "b", coef = "GAPg350Mg200"),
             prior(normal(-0.2, 0.5), class = "b", coef = "GAPg500Mg350"),
             prior(normal(-0.2, 0.5), class = "b", coef = "GAPg650Mg500"),
             prior(normal(-0.2, 0.5), class = "b", coef = "GAPg800Mg650"),
             prior(normal(-0.2, 0.5), class = "b", coef = "GAPg950Mg800"))
hd.model1 <- brm(Rating ~ 1 + GAP + (1 + GAP| sub) + (1 + GAP| item),
                 data = hd,
                 init = 0,
                 family = cumulative("probit"),
                 chains = 4, 
                 warmup = 1000,
                 iter = 5000,
                 prior = prior.1,
                 sample_prior = "only",
                 thin = 1,
                 cores = 4)

but the result is interesting:

Population-Level Effects: 
             Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept[1]    -5.11      4.43   -20.21    -0.27 1.01      414      117
Intercept[2]    -2.07      1.97    -6.74     0.99 1.00     1236      899
Intercept[3]    -0.61      1.50    -3.84     2.16 1.00     5060     3504
Intercept[4]     0.58      1.49    -2.30     3.71 1.00     6105     3309
Intercept[5]     1.99      1.83    -1.02     6.27 1.00     7118     6627
Intercept[6]     4.79      4.76     0.15    15.19 1.00     4316     5657
GAPg350Mg200    -0.19      0.50    -1.19     0.80 1.00     9648     8571
GAPg500Mg350    -0.20      0.51    -1.17     0.81 1.00     6132     5808
GAPg650Mg500    -0.21      0.50    -1.18     0.79 1.00     5494     7874
GAPg800Mg650    -0.20      0.49    -1.15     0.76 1.00     9779    10689
GAPg950Mg800    -0.21      0.51    -1.21     0.77 1.00     5440     5966

So, My question is, why are all beta values basically the same after I set the prior, and why is there such a big difference from the default prior; Or is my prior setting incorrect? I hope to set a prior, after all, previous studies have reached such conclusions, and I also need to calculate the Bayesian factor.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant