# SPSS: GLMM and(adjusted) odds ratio

I am performing a retrospective study and the relative statistic analysis. I am studying the the risk factors for the occurrence of complications during medical procedures.

I have 50 subjects undergoing a total of 250 procedures. The number of procedures per subject may vary (2-10). I got 3 fixed effects for the subjects (sex, age, pathology_type), and 5 fixed effects (firstprocedure where painfulprocedure anestheticapproach respiratorysupport) for the procedures. I am running a GLMM on SPPS.

This is the code.

*Generalized Linear Mixed Models.
GENLINMIXED
/DATA_STRUCTURE SUBJECTS=@#paziente
/FIELDS TARGET=complicatedprocedure TRIALS=NONE OFFSET=NONE
/FIXED  EFFECTS=sex age pathology_type firstprocedure where painfulprocedurepain anestheticapproach respiratorysupport USE_INTERCEPT=TRUE
/RANDOM EFFECTS=@#paziente USE_INTERCEPT=TRUE COVARIANCE_TYPE=VARIANCE_COMPONENTS
/BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100 CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=ROBUST PCONVERGE=0.000001(ABSOLUTE) SCORING=0 SINGULAR=0.000000000001
/EMMEANS TABLES=sex COMPARE=sex CONTRAST=PAIRWISE
/EMMEANS TABLES=pathology_type COMPARE=pathology_type CONTRAST=PAIRWISE
/EMMEANS TABLES=where COMPARE=where CONTRAST=PAIRWISE
/EMMEANS TABLES=painfulprocedurepain COMPARE=painfulprocedure CONTRAST=PAIRWISE
/EMMEANS TABLES=anestheticapproach COMPARE=anestheticapproach CONTRAST=PAIRWISE
/EMMEANS TABLES=respiratorysupport COMPARE=respiratorysupport CONTRAST=PAIRWISE


I have a series of questions:

1. I do not clearly understand the warning below. I tried to look around, but it appears to me that this is a problem that may occur frequently and sometimes there is no major error in the statistical methods. By the way, the output is not weird at all. To the contrary, I pretty much have results fitting with expected.

A warning.

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. Data Structure: One or more subject fields were specified but not actually used in the analysis.

So, in the end, when I receive such warning, what should I do? Does my data mean anything?

2. In the output, is Exp (Coefficient) the adjusted odds ratio?

3. In the case, if Exp (Coefficient) of A vs. B is 0.021, may I say that the Exp (Coefficient) of B vs. A is 1/0.021=47?

A non-positive definite Hesssian matrix is indeed a problem, and you should not trust your results. If you search the web for some variations of "Hessian matrix not positive definite" then you will find many answers. On my most resent encounter with this problem I assembled the following possible fixes that I tried, in order:

1. make sure no large amounts of missing data
2. check scaling of predictor variables; If an order of magnitude or more off, the model might have trouble calculating variances
3. check all variables to make sure none is a constant
4. check if there is a near perfect linear dependency b/t two variables (e.g., height & weight); if so, one may be deleted
5. reduce the number of exclusions (they could combine to leave you with less variation in your data)
6. check if a random intercept captures all the variation
7. make sure have specified a SUBJECT variable on the RANDOM subcommand
8. make sure there is level 2 variation in the outcome
9. make sure there are level 2 predictors
10. run models and check if some covariance estimates are either 0 or have no estimate or no standard errors at all
11. increase the number of MAX ITERATIONS
12. increase the number of (Fisher steps) for SCORING
13. remove INTERCEPT from RANDOM line (may not be needed & may make solution impossible to obtain if it makes no difference)
14. use a simpler covariance structure (with fewer unique parameters; avoids redundant parameters)
15. check if too many levels of the random effect and not enough fixed observations within each random level
16. try using a different missing data technique
17. if hypothesis allows it, run a population-averaged (repeated measures) model (which has no random effects, but accounts for correlations within individuals)
18. work directly with eigenvalues to adjust zeros up to .05

My matrix was positive definite when I got to #12. Scaling the variables to within the same order of magnitude and increasing the max iterations seemed to help the most, but every dataset is going to be different.

I have no fix for the error message: Data Structure: One or more subject fields were specified but not actually used in the analysis.