5

I don't know if I need to get rid of some data, or what is going on here. Models 1 and 2 work perfectly fine. Model 3 won't run.

model1 <- clogit(Used ~ Slope + strata(OBJECTID), data=old)

model2 <- clogit(Used ~ Aspect + strata(OBJECTID), data=old)

model3 <- clogit(Used ~ Slope + Aspect + strata(OBJECTID), data=old)

Model 3 gives the following error:

> Error in fitter(X, Y, strats, offset, init, control, weights =
> weights,  :    NA/NaN/Inf in foreign function call (arg 5)

It additionaly gives warnings of:

> In fitter(X, Y, strats, offset, init, control, weights = weights,  :  
> Ran out of iterations and did not converge

I am less concerned about the warnings as other models also give this, but actually have outputs.

I can post the data if I need to, or if you have an idea that can point me in the right direction, that would be awesome.

-dan

****** Additional Info *******

RPackages: survival

> o.s.model <- clogit(Used ~ Slope + strata(OBJECTID), data=old)
> o.a.model <- clogit(Used ~ Aspect + strata(OBJECTID), data=old)
> o.sa.model <- clogit(Used ~ Slope + Aspect + strata(OBJECTID), data=old)
Error in fitter(X, Y, strats, offset, init, control, weights = weights,  : 
  NA/NaN/Inf in foreign function call (arg 5)
In addition: Warning message:
In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Ran out of iterations and did not converge
> 

Both Slope and Aspect are numberical.

dataset at: https://drive.google.com/file/d/1AXKMJnDs_JYZmy_gB3IaMXHL34_ejxz3/view?usp=sharing

Kristofersen
  • 2,736
  • 1
  • 15
  • 31
Dan Graham
  • 61
  • 1
  • 5
  • 1
    whithout any reprex , we cant help you. please use dput to give use a minimal reproductible example. – Vincent Guyader Feb 23 '18 at 21:45
  • how small are your strata? It's possible that both variables form a perfect fit for one of them and that clogit expects a perfect fit to be impossible (and divides something by the error, resulting in an inf) – Pdubbs Feb 23 '18 at 21:55
  • The data only has 3 points per strata, a used location and 2 random points. – Dan Graham Feb 23 '18 at 22:04
  • @Pdubbs, Is there a way to search for that without just outright deleting data and trying again? – Dan Graham Feb 23 '18 at 22:15
  • So.... I found a problem with the data file that isn't in the original file. Sorry. Hopefully this fixes the problem. – Dan Graham Feb 23 '18 at 22:20

1 Answers1

3

This could be due to ties in the dataset. Try fitting the model with either the efron or breslow approximation (method='efron'). Solved the issue for me...

see also here: https://stats.stackexchange.com/questions/109222/conditional-logistic-regression-model-does-not-converge-but-logistic-regression

jayathecat
  • 41
  • 3