Reputation: 201
I am encountering some issues with my data and need some help. I am trying to run glm analysis with a presence/absence variable as response variable and several explanatory variable (time, location, presence/absence data, abundance data).
First I tried to use the glm() function, however I was having 2 warnings concerning glm.fit () : 1: glm.fit: algorithm did not converge 2: glm.fit: fitted probabilities numerically 0 or 1 occurred After some investigation I found out that the problem was most probably quasi complete separation and therefor decide to use brglm and/or logistf.
logistf : analysis does not run When running logistf() I get a error message saying : error in chol.default(x) : leading minor 39 is not positive definite I looked into logistf package manual, on Internet, in the theoretical and technical paper of Heinze and Ploner and cannot find where this function is used and if the error can be fixed by some settings.
brglm : analysis run However I get a warning message saying : In fit.proc(x = X, y = Y, weights = weights, start = start, etastart # = etastart, : Iteration limit reached Like before i cannot find where and why this function is used while running the package and if it can be fixed by adjusting some settings.
In a more general way, I was wondering what are the fundamental differences of these packages.
I hope this make sense enough and I am sorry if this is kind of statistical evidence that I'm not aware of.
It is my first time asking a question so I apologize if it's not like it should be and kindly ask you to not hesitate to let me know about it.
Thank you for your help
Xochitl C.
Here an extract of my table (I had to truncate the row in the length because the table is too wide: 20 columns) and the different formula I run :
head ()
Year Quarter Subarea Latitude Longitude Presence.S CPUE.S Presence.H CPUE.H Presence.NP
1 2000 1 31F1 51.25 1.5 0 0 0 0 0
2 2000 1 31F2 51.25 2.5 0 0 0 0 0
3 2000 1 32F1 51.75 1.5 0 0 0 0 0
4 2000 1 32F2 51.75 2.5 0 0 0 0 0
5 2000 1 32F3 51.75 3.5 0 0 0 0 0
6 2000 1 33F1 52.25 1.5 0 0 0 0 0
tail ()
Year Quarter Subarea Latitude Longitude Presence.S CPUE.S Presence.H CPUE.H
4435 2012 3 50F3 60.75 3.5 1 103.000 1 110.000
4436 2012 3 51E8 61.25 -1.5 1 1311.600 1 12.000
4437 2012 3 51E9 61.25 -0.5 1 34.336 1 46.671
4438 2012 3 51F0 61.25 0.5 1 430.500 1 148.000
4439 2012 3 51F1 61.25 1.5 1 115.000 1 85.000
4440 2012 3 51F2 61.25 2.5 1 72.500 1 5.500
logistf_binomPres <- logistf (Presence.S ~ (Presence.BW + Presence.W + Presence.C + Presence.NP +Presence.P + Presence.H +CPUE.BW + CPUE.H + CPUE.P + CPUE.NP + CPUE.W + CPUE.C + Year + Quarter + Latitude + Longitude)^2, data = CPUE_table)
Brglm_binomPres <- brglm (Presence.S ~ (Presence.BW + Presence.W + Presence.C + Presence.NP +Presence.P + Presence.H +CPUE.BW + CPUE.H + CPUE.P + CPUE.NP + CPUE.W + CPUE.C + Year + Quarter + Latitude + Longitude)^2, family = binomial, data = CPUE_table)
Upvotes: 5
Views: 2746
Reputation: 302
For what it's worth, I also encountered the "leading minor i is not positive definite" error.
This was due to my ith variable being identical for all observations. Removing this variable addressed the issue.
Hope this helps
B
Upvotes: 1