Transitioning from HDDM to HSSM: Specifying between and within subject variables in the HSSM #287
Replies: 2 comments 3 replies
-
HSSM allows you to use the wilcoxon formula notation to specify regression models, which allow for random effects across any categorical variable. You can check the main tutorial in the documentation for some examples, but you might also find the Bambi documentation useful for some broader examples on how to use the formula notation (HSSM builds on Bambi to process general linear models). Finally, Bambi in turn builds on the formulae package specifically to build design-matrices from model strings. In case you are familiar with the lme4 package in R for mixed-effects regression, you are essentially able to specify model formulas the same way as in this widely used package. Specifically to your question, you may want to try something like this,
which should create category wise and subject wise random effects (so one parameter per subject for each category, or conversely for each subject one parameter per category). Let us know if this doesn't help. Alex |
Beta Was this translation helpful? Give feedback.
-
Hello Billy, I am also just transitioning from HDDM to HSSM, and finding it difficult to work out the syntax to define between subjects and within subjects variables. I was hoping you have some breakthrough and can share how you defined your variables? I have 1 between subjects variable (group:3 levels), and one within subjects variable (condition:2 levels). I can't seem to see an example of a mixed design in the HSSM tutorial to follow. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I'm new to the HSSM package, so please excuse my questions if they seem less specialized.
In the HSSM documentation:
Experiment Background
However, there remains a lingering question about specifying category variables in this context.
I'm currently working with a dataset that involves three independent variables. One of these variables is a between-subjects variable Type (A, B), while the other two are within-subjects variables with Magnitude (none, small, large), and Valence (reward, punishment).
Question
My main inquiry is how to specify the model in HSSM to account for these variables.
In the past, during the HDDM era, we had options such as using hddm.HDDM() with depends_on or employing hddm.HDDMRegressor(). Given the mixed design of my study, it seems more appropriate to use hddm.HDDMRegressor. However, I have problem about this choice because the output does not seem to provide parameter values for each subject under different conditions.
For instance, using depends_on={'v':['type','magnitude','valence']} in hddm.HDDM(), we could obtain parameter values (v) for each condition and each subject within the combinations of magnitude and valence.
Conversely, when using hddm.HDDMRegressor(), the output only displays parameters for each subject across the entire experiment, without breakdowns for individual conditions.
The reason need to get the parameters for each subject at each level of the variables is that finding the interaction effect between two group, so I need the parameters for each subject in the different conditions to use the ANOVA.
How to solve problem in HSSM
As for my previous question in HDDM, if I opt for hddm.HDDMRegressor, how should I structure my variables?
For now, in HSSM, I wonder how to best specify the model in this framework. Additionally, does the specified model output the parameters for each subject at each level of the categorical variables?
I appreciate any insights and guidance on this matter. Thank you!
Billy
Beta Was this translation helpful? Give feedback.
All reactions