0

When running glm in R using tweedie and log link, I run into

"Error in glm.fit ... NA/NAN/INF in x"

I have tried using different distributions and links. I have also tried adding 1 to the response because it is insurance data with lots of 0s.

I have already checked for na's, nan's, and inf values and have none in my dataset (or have already corrected for them).

Here is the code I have:

fit = glm(y~x, data=data1,
             family=tweedie(var.power=1.6, link.power=0), weights=weights)
Mihai Chelaru
  • 7,614
  • 14
  • 45
  • 51
rm1906
  • 1
  • can you share your data? does a tweedie distribution support using weights (just curious)? – Mike Aug 26 '19 at 19:30
  • Unfortunately I can't share the data. I don't see why it wouldn't be able to, I think the weights are used to "weight" each observations contribution to the loglikelihood summation. Something like weight(i)*loglikelihood(i). – rm1906 Aug 26 '19 at 19:46
  • I do wonder, would it have anything to do with the "start" input in the glm function? I think that gives starting values for the iterative least squares algorithm...or am i wrong? – rm1906 Aug 26 '19 at 19:50
  • good question, I am out of my depth here but there might be an answer on cross validated that might help you. – Mike Aug 26 '19 at 20:30
  • Check your `x` variable. Is one of the values not finite (`Inf`) or not a number (`NaN`)? – aosmith Aug 26 '19 at 21:44
  • I have yes, I can confirm that is not the issue. I think it had to do with starting values in the GLM. I will run a few tests to confirm this today. – rm1906 Aug 27 '19 at 13:22

0 Answers0