I want to run the null model for a binary outcome, to check what proportion of the variance is caused by clustering of the data. I have 144 measures from 35 respondents. But the model doesn't run. It also doesn't work when I add fixed effects like 'gender'. When I do a LMM on the original variable which is not binary, the model runs without a problem.
I use the following syntax for my model: GENLINMIXED /DATA_STRUCTURE SUBJECTS=id /FIELDS TARGET=TrustSharingBinary TRIALS=NONE OFFSET=NONE /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT /FIXED USE_INTERCEPT=FALSE /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100000 CONFIDENCE_LEVEL=95 DF_METHOD=SATTERTHWAITE COVB=ROBUST PCONVERGE=0.000001(ABSOLUTE) SCORING=100000 SINGULAR=0.000000000001 /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD. I get the following warnings: glmm: One or more records are not used in the analysis because they have one or more fields with invalid or missing values. glmm: Valid values for events (target) and trials variables are non-negative and positive integers respectively, and the number of trials cannot be less than the number of events. not enough array elements Execution of this command stops. I'm guessing there could be something about the structure of the data, so I wanted to add this table (about 30% of the data is missing, but this is mostly missing by design, and my guess is I still have sufficient datapoints to run this model): |
You need to have a Random statement in there because, at the minimum, you have a random intercept. I think the subjects part of your data structure command is wrong. You have, I guess, measures within persons and those measures are numbered by some variable that together with id defines unique records. I think delete the fixed effects command entirely. The only effect that you have is a random intercept and it is included by default.
Lastly, you have an average of four records per person and I think it will be tough to get a multllevel logistic to work with that few records but, for your sake, I'd be happy to be wrong. Gene Maguin Here's an example that ran genlinmixed /data_structure subjects=clus*rec/fields target=u1/ target_options reference=0 distribution=binomial/fixed effects=w/ random use_intercept=true subjects=clus. This has a level 2 predictor: w. The DV, u1, is coded 0-1, with 0 being the reference. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Sarah Deweert Sent: Tuesday, October 11, 2016 11:45 AM To: [hidden email] Subject: GLMM - not enough array elements I want to run the null model for a binary outcome, to check what proportion of the variance is caused by clustering of the data. I have 144 measures from 35 respondents. But the model doesn't run. It also doesn't work when I add fixed effects like 'gender'. When I do a LMM on the original variable which is not binary, the model runs without a problem. I use the following syntax for my model: GENLINMIXED /DATA_STRUCTURE SUBJECTS=id /FIELDS TARGET=TrustSharingBinary TRIALS=NONE OFFSET=NONE /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT /FIXED USE_INTERCEPT=FALSE /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100000 CONFIDENCE_LEVEL=95 DF_METHOD=SATTERTHWAITE COVB=ROBUST PCONVERGE=0.000001(ABSOLUTE) SCORING=100000 SINGULAR=0.000000000001 /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD. I get the following warnings: glmm: One or more records are not used in the analysis because they have one or more fields with invalid or missing values. glmm: Valid values for events (target) and trials variables are non-negative and positive integers respectively, and the number of trials cannot be less than the number of events. not enough array elements Execution of this command stops. I'm guessing there could be something about the structure of the data, so I wanted to add this table (about 30% of the data is missing, but this is mostly missing by design, and my guess is I still have sufficient datapoints to run this model): <http://spssx-discussion.1045642.n5.nabble.com/file/n5733228/data.png> -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/GLMM-not-enough-array-elements-tp5733228.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Thanks. I've tried adjusting several things, such as add the measures within each ID, (indeed each respondent answered the same question about different organisations), removed the fixed intercept and tweaked with several random statements. I still get the same warnings, and some added ones. Do you still find something wrong with my model specification?
GENLINMIXED /DATA_STRUCTURE SUBJECTS=id*RefOrg /FIELDS TARGET=TrustSharingBinary TRIALS=NONE OFFSET=NONE /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT /FIXED USE_INTERCEPT=FALSE /RANDOM EFFECTS=Ability_Agg USE_INTERCEPT=TRUE SUBJECTS=id COVARIANCE_TYPE=VARIANCE_COMPONENTS /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=10000 CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=MODEL PCONVERGE=0.000001(ABSOLUTE) SCORING=0 SINGULAR=0.000000000001 /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD. Warnings glmm: One or more records are not used in the analysis because they have one or more fields with invalid or missing values. glmm: Valid values for events (target) and trials variables are non-negative and positive integers respectively, and the number of trials cannot be less than the number of events. glmm: The estimated covariance matrix of the random effects (the G matrix) is not positive definite. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. glmm: The final Hessian matrix is not positive definite although all convergence criteria are satisfied. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. not enough array elements Execution of this command stops. |
Let's look at the warnings.
>>glmm: One or more records are not used in the analysis because they have one or more fields with invalid or missing values. Have you done an analysis to identify how many records in total and by respondent have missing/invalid data for your DV: TrustSharingBinary? >>glmm: Valid values for events (target) and trials variables are non-negative and positive integers respectively, and the number of trials cannot be less than the number of events. I'm not sure about this but you said you've ran this dataset through Mixed without problems. May I assume that the DV was TrustSharing? Does a frequencies show that TrustSharingBinary is a dichotomous variable? If you do a means command on TrustSharingBinary by id, do some ids have a mean of either 0 or 1? That's a problem because the logit is undefined. I don't know enough to know how that situation is handled in the routine. Also, I guess that if TrustSharingBinary had values of 1 2 3 4, genlinmixed would be expecting valid data for the trials subcommand. >>glmm: The estimated covariance matrix of the random effects (the G matrix) is not positive definite. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. >>glmm: The final Hessian matrix is not positive definite although all convergence criteria are satisfied. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. not enough array elements I think these warnings are the result of earlier problems. You've said you have 144 records from 35 respondents, basically four records per person. I doubt that you can get to run as a multilevel logistic model. That said, I suggest removing Ability_Agg from the random subcommand because the simplifies the model dramatically. Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Sarah Deweert Sent: Wednesday, October 12, 2016 4:03 AM To: [hidden email] Subject: Re: GLMM - not enough array elements Thanks. I've tried adjusting several things, such as add the measures within each ID, (indeed each respondent answered the same question about different organisations), removed the fixed intercept and tweaked with several random statements. I still get the same warnings, and some added ones. Do you still find something wrong with my model specification? GENLINMIXED /DATA_STRUCTURE SUBJECTS=id*RefOrg /FIELDS TARGET=TrustSharingBinary TRIALS=NONE OFFSET=NONE /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT /FIXED USE_INTERCEPT=FALSE /RANDOM EFFECTS=Ability_Agg USE_INTERCEPT=TRUE SUBJECTS=id COVARIANCE_TYPE=VARIANCE_COMPONENTS /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=10000 CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=MODEL PCONVERGE=0.000001(ABSOLUTE) SCORING=0 SINGULAR=0.000000000001 /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD. Warnings glmm: One or more records are not used in the analysis because they have one or more fields with invalid or missing values. glmm: Valid values for events (target) and trials variables are non-negative and positive integers respectively, and the number of trials cannot be less than the number of events. glmm: The estimated covariance matrix of the random effects (the G matrix) is not positive definite. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. glmm: The final Hessian matrix is not positive definite although all convergence criteria are satisfied. The procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain. not enough array elements Execution of this command stops. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/GLMM-not-enough-array-elements-tp5733228p5733239.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |