Hello,
I would like to perform a binary logistic regression with two outcomes (response to treatment: yes=1 or no=0) and five potential predictor variables. The treatment response was analyzed at two time points: one earlier time point (time point 1) and one later time point (time point 2), which means I have repeated measures data here for the dependent variable.
My research question is: Which predictor variables are good predictors for a response at time point 1 and which are good predictors for a response at time point 2?
I have been suggested to use the GAMLj3 module for creating a generalized mixed model and selecting logistic model in that module. I downloaded this module and it is now available from within Jamovi.
When opening "General Linear Mixed Model" from GAMLj3, the categorial dependent variable would be "Logistic". Then, I have fields for "Dependent Variable", "Factors", "Covariates" and "Cluster variables". All my predictor variables are continuous, so they would go into "Covariates". But the field "Dependent Variable" can only take one variable. So, how would I enter the data for the two time points? They are the same variable, i.e. the response, but at two different time points.
I uploaded some example data in CSV, Excel and Jamovi format because this may make it easier to understand the structure of my data.
CSV format: https://u.pcloud.link/publink/show?code ... 6rBfwWRy4V
Excel format: https://u.pcloud.link/publink/show?code ... Xfj0QSJR8V
Jamovi format: https://u.pcloud.link/publink/show?code ... 1zeY4UVOgV
Binary logistic regression for repeated measures data with GAMLj3
-
- Posts: 33
- Joined: Mon Feb 19, 2024 9:44 am
-
- Posts: 33
- Joined: Mon Feb 19, 2024 9:44 am
Re: Binary logistic regression for repeated measures data with GAMLj3
Do I have to create another column, which identifies the time point so that I can put all data from the two time points into one variable column, then use this one column as dependent variable and use the additional column as a cluster variable? Or do I have use the time point column as a fixed factor?
- mcfanda@gmail.com
- Posts: 502
- Joined: Thu Mar 23, 2017 9:24 pm
Re: Binary logistic regression for repeated measures data with GAMLj3
Mixed models, including the generalized ones, need the file to be in the long format: one observation- one row. In the long format file there will be a variable that keeps track of the participant id, so we know whose participants the scores are. Starting with your file, you can use package "jReshape" to flip the file into a long format one. Here an example of what the file should look like
In the long format file your dep var is called "y". Now you can apply the mixed logistic model like this
(set your random coefficients in the "Random effects" and you have your model
In the long format file your dep var is called "y". Now you can apply the mixed logistic model like this
(set your random coefficients in the "Random effects" and you have your model
-
- Posts: 33
- Joined: Mon Feb 19, 2024 9:44 am
Re: Binary logistic regression for repeated measures data with GAMLj3
Thank you very much for the explanation!
You attached two screenshots to your replay. However, I can only see one here. It looks like this on my computer: Why is that?
You attached two screenshots to your replay. However, I can only see one here. It looks like this on my computer: Why is that?