To fit a growth curve model for a binary outcome in R, you can use the glmer
function from the lme4
package. This is a mixed effects model function that allows you to include fixed and random effects in the model.
Here is an example code for fitting a growth curve model for a binary outcome using glmer
:
main.r187 chars8 lines
In this code, we are fitting a growth curve model for a binary outcome outcome
using the predictor time
. We are also including subject
as a random intercept and slope with 1 + time | subject
. The family = binomial()
specifies the binomial family for the binary outcome.
Once the model is fit, we can use summary
function to see the model output.
Note: make sure to have a clear understanding of mixed effects models before attempting to fit one.
gistlibby LogSnag