Question about variable type

33 views
Skip to first unread message

David Sidhu

unread,
Mar 21, 2018, 4:15:48 PM3/21/18
to brms-users
I am using the Cauchy prior recommended in Gelman et al. (2008). I know you've mentioned this has issues, but I think my question will apply beyond this particular prior.

Gelman et al. recommend rescaling all predictors and outcome variables to have a mean of 0 and Sd of 0.5.

For dichotomous predictors with an uneven number of observations per group this might end up with one group having a value of 0.55 and another a value of 0.45, for example.

I am currently setting these dichotomous predictors to be numeric variables. Is that correct, for the purpose of running a regression in brms?

It also seems like my transformed outcome variable becomes a matrix. Is that okay?

Thanks!

Paul Buerkner

unread,
Mar 21, 2018, 4:19:17 PM3/21/18
to David Sidhu, brms-users
The Cauchy prior is fine. It just has issues when one tries to compute Bayes factors via hypothesis(). That's all.



Is that correct, for the purpose of running a regression in brms?

That seems correct to me.



It also seems like my transformed outcome variable becomes a matrix. Is that okay?  

Why does that happen? Is your outcome multivariate?


--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/45b22ae8-0011-4ce3-8119-3dc84026494d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Sidhu

unread,
Mar 21, 2018, 4:39:13 PM3/21/18
to brms-users
Why does that happen? Is your outcome multivariate? 

I've been using the rescale() function to standardize the variables, and it returns either a dataframe or a matrix. I just now tried running the model with the outcome as a numeric variable instead of a matrix and it seems to give the same result.

On Wednesday, 21 March 2018 14:19:17 UTC-6, Paul Buerkner wrote:
The Cauchy prior is fine. It just has issues when one tries to compute Bayes factors via hypothesis(). That's all.


Is that correct, for the purpose of running a regression in brms?

That seems correct to me.


It also seems like my transformed outcome variable becomes a matrix. Is that okay?  

Why does that happen? Is your outcome multivariate?

2018-03-21 21:15 GMT+01:00 David Sidhu <dms...@gmail.com>:
I am using the Cauchy prior recommended in Gelman et al. (2008). I know you've mentioned this has issues, but I think my question will apply beyond this particular prior.

Gelman et al. recommend rescaling all predictors and outcome variables to have a mean of 0 and Sd of 0.5.

For dichotomous predictors with an uneven number of observations per group this might end up with one group having a value of 0.55 and another a value of 0.45, for example.

I am currently setting these dichotomous predictors to be numeric variables. Is that correct, for the purpose of running a regression in brms?

It also seems like my transformed outcome variable becomes a matrix. Is that okay?

Thanks!

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

Paul Buerkner

unread,
Mar 21, 2018, 4:45:44 PM3/21/18
to David Sidhu, brms-users
If its a matrix with one column, there won't be any problems. Otherwise, brms will return an error anyway.

To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.

David Sidhu

unread,
Apr 6, 2018, 4:36:24 PM4/6/18
to brms-users
Just a follow up to this:

Is that correct, for the purpose of running a regression in brms? 

That seems correct to me.

If I don't scale my dichotomous predictor (i.e., leave it as 0s and 1s), is it incorrect to make it a factor?

Paul Buerkner

unread,
Apr 6, 2018, 4:40:53 PM4/6/18
to David Sidhu, brms-users
I don't understand the question sorry.

David Sidhu

unread,
Apr 6, 2018, 4:47:25 PM4/6/18
to brms-users
Sorry, I wasn't very clear.

In an earlier reply you'd said that if I have a dichotomous predictor, it was correct to make that predictor a numeric variable.
I'm wondering if it also (or instead?) makes sense to have that variable be a factor? The two levels are coded as 0 and 1.

Paul Buerkner

unread,
Apr 6, 2018, 4:57:51 PM4/6/18
to David Sidhu, brms-users
if I understand you correctly and if you use dummy coding for your factor  (the default) this will end up being the same. that is one level coded as 0 and one as 1.

David Sidhu

unread,
Apr 6, 2018, 5:27:42 PM4/6/18
to brms-users
Gotcha, thanks!
Reply all
Reply to author
Forward
0 new messages