Binary logistic regression for repeated measures data with GAMLj3

Discuss statistics related things
Post Reply
Biochemist
Posts: 33
Joined: Mon Feb 19, 2024 9:44 am

Binary logistic regression for repeated measures data with GAMLj3

Post by Biochemist »

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
Biochemist
Posts: 33
Joined: Mon Feb 19, 2024 9:44 am

Re: Binary logistic regression for repeated measures data with GAMLj3

Post by Biochemist »

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?
User avatar
mcfanda@gmail.com
Posts: 502
Joined: Thu Mar 23, 2017 9:24 pm

Re: Binary logistic regression for repeated measures data with GAMLj3

Post by mcfanda@gmail.com »

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
pic1.png
pic1.png (146.13 KiB) Viewed 2588 times
In the long format file your dep var is called "y". Now you can apply the mixed logistic model like this
pic2.png
pic2.png (123 Bytes) Viewed 2588 times
(set your random coefficients in the "Random effects" and you have your model
Biochemist
Posts: 33
Joined: Mon Feb 19, 2024 9:44 am

Re: Binary logistic regression for repeated measures data with GAMLj3

Post by Biochemist »

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:
Pic2 not shown.png
Pic2 not shown.png (160.48 KiB) Viewed 2540 times
Why is that?
Post Reply