0

I am trying to fit the following generalized linear mixed-effects model for the negative binomial family. I have 18 predictors but the model only uses 13 predictors and leaves two out. If I fit the model for 17 predictors, it still fits the model using 13 variables but now includes one that was not used before.

I am not sure why the model does not use all variables in the model and strictly uses 13 variables. All predictors are numeric except one.

model1 = glmer.nb(y ~ x1 + x2 + x3 + ... + x18 + (1|x19), data = my.data)

Note: I am trying to fit interrupted time series model.

Justin
  • 374
  • 1
  • 3
  • 9
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Be clear what packages you are using in the code. This syntax looks wrong. Are `x2`, `x3`, etc supposed to be in the formula? If so those should be separated with `+` and not `,`. How many rows of data do you have? Are any of your columns linearly dependent on the others? – MrFlick Aug 31 '23 at 14:35
  • Sorry, I use + instead of comma. I just wanted to give an overall idea of what the model looks like. Unfortunately, the data is confidential and I cannot share on public platforms. – Justin Aug 31 '23 at 14:41
  • Well, without any sort of reproducible example, I'm afraid that any assistance would be confidential as well. But I would start by looking for collinearity in your data. – MrFlick Aug 31 '23 at 14:46
  • Can you make up some data that looks similar but has no identifiers? – CAWA Aug 31 '23 at 16:39

0 Answers0