Hi everyone,
I would very much appreciate your help with an issue I have with a meglm that I'm trying to fit to my ecological momentary assessment data.
I am trying to predict four different behaviors by affect. All variables were measured approx. eight times a day for four days (although not all participants have values for all time points, but I included only those with at least 50% response rate). Affect is included both as a person-mean throughout the EMA-period and as a person-mean-centered lagged (t-1) variable to predict behavior at t. I have also included covariates and want to include random slopes, because I'm assuming based on theory that the association between affect and behavior is not constant across participants (I plan to do moderation analyses later). I also chose
because the depvar is highly skewed. Behaviors were rated from 0-100, to be able to conduct meglm with gamma I added a constant of +1, and then divided the values by 10, to facilitate interpretation, so now my values range from 0.1-10.1.
That's my code (stid denotes the participant's id):
The models converge for the first three behaviors, but not the fourth. I get the following:
As described in the documentation, I tried different strategies to refine the starting values, but nothing worked. I have data from 756 participants and a total of 7,108 assessments for that particular variable, so I expected this should not be because of non-sufficient data?
I have also read in a different forum (not the safest source) that gamma regression (or meglmg in that case) sometimes has problems when there are many depvar-values close to zero, which my many values of 0.1 might be. I added another constant of +1 to my depvar, then resulting in values from 1.1 to 11.1. Strangely enough, my model converged afterwards, but I also applied the constant to the other three behavior variables and it affected the coeffients and the p-values quite a bit. Also, it feels kind of messy to me. I would be extremely grateful for any type of advice. I'm very new to multilevel modelling altogether and I'm kind of not really sure if my approach is correct in the first place.
Thank you so much in advance!
Update: The model converges without problems if I don't include the random slopes. But as described above, it would be very important for me to include them.
I would very much appreciate your help with an issue I have with a meglm that I'm trying to fit to my ecological momentary assessment data.
I am trying to predict four different behaviors by affect. All variables were measured approx. eight times a day for four days (although not all participants have values for all time points, but I included only those with at least 50% response rate). Affect is included both as a person-mean throughout the EMA-period and as a person-mean-centered lagged (t-1) variable to predict behavior at t. I have also included covariates and want to include random slopes, because I'm assuming based on theory that the association between affect and behavior is not constant across participants (I plan to do moderation analyses later). I also chose
Code:
family(gamma) link(log)
That's my code (stid denotes the participant's id):
Code:
meglm behav4 mean_affect affect_center_lag1 age sex BMI_SDS comorbidity|| stid: mean_affect affect_center_lag1 , family(gamma) link(log)
Code:
Iteration 4: log likelihood = -7367.9063 (not concave) Iteration 5: log likelihood = -7098.5702 (not concave) Iteration 6: log likelihood = -7047.0597 Iteration 7: log likelihood = -6706.5632 Iteration 8: log likelihood = -6450.9112 Iteration 9: log likelihood = -6436.6564 numerical derivatives are approximate nearby values are missing Iteration 10: log likelihood = -6416.6034 numerical derivatives are approximate nearby values are missing Iteration 11: log likelihood = -6410.657 numerical derivatives are approximate nearby values are missing Iteration 12: log likelihood = -6406.1232 numerical derivatives are approximate nearby values are missing Iteration 13: log likelihood = -6402.6428 numerical derivatives are approximate nearby values are missing Iteration 14: log likelihood = -6399.9874 numerical derivatives are approximate nearby values are missing Iteration 15: log likelihood = -6396.1924 could not calculate numerical derivatives -- discontinuous region with missing values encountered could not calculate numerical derivatives -- discontinuous region with missing values encountered
I have also read in a different forum (not the safest source) that gamma regression (or meglmg in that case) sometimes has problems when there are many depvar-values close to zero, which my many values of 0.1 might be. I added another constant of +1 to my depvar, then resulting in values from 1.1 to 11.1. Strangely enough, my model converged afterwards, but I also applied the constant to the other three behavior variables and it affected the coeffients and the p-values quite a bit. Also, it feels kind of messy to me. I would be extremely grateful for any type of advice. I'm very new to multilevel modelling altogether and I'm kind of not really sure if my approach is correct in the first place.
Thank you so much in advance!
Update: The model converges without problems if I don't include the random slopes. But as described above, it would be very important for me to include them.