strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

Handling of auto_prior for variables with space in categorical value #97

Open PCK1992 opened 4 years ago

PCK1992 commented 4 years ago

I have encountered a potential bug in the auto_prior() function handling of categorical variables that contain spaces

For example when I use auto_prior(data) and the data contains a factor variable with spaces in the individual categories (e.g. outcome 1 instead of outcome_1) priors are assigned but when you plug in the priors into brm() I get the following error: The following priors do not correspond to any model parameter: outcome 2 ~ normal(0, 1) outcome 3 ~ normal(0, 1) Function 'get_prior' might be helpful to you.

The reference category is not mentioned. When I change the coding of the variable to outcome_2 by replacing the space everything works as expected.

strengejacke commented 4 years ago

Do you have a small reproducible example?