Skip to content
Prev 18393 / 20628 Next

vif using GLMMadaptive

I am a PhD student and am working on a school  project due over the weekend.  I ran the following regression:
spending.REG <- glm.nb(spending_count ~ conservative + liberal + moderate + trust_gov + liberal*trust_gov + conservative*trust_gov + moderate*trust_gov + income + education + age + female + white + budget_difficult + democrat + republican, data = Trustdata1)

I attempted to get a vif score and got this error in R Studio: there are aliased coefficients in the model

The variables conservative, liberal and moderate are fixed effect where they are either 0 or 1.  The female variable is a 0 or 1.  There are three interactive variables:  moderate*trust_gov, liberal*trust_gov, and conservative*trust_gov.  Moreover, moderate and moderate*trust_gov are the base variables.

I would like to calculate the vif for the regression equation.  First, in order to get rid of the error and thereafter calculate the vif scores, I attempted to use your code:

library("GLMMadaptive")

fm <- mixed_model(y ~ time + sex, random = ~ 1 | id, data = <your_data>,
family = zi.negative.binomial(), zi_fixed = ~ sex, zi_random = ~ 1 | id)

it returned an error: unexpected '=' in: "erate + trust_gov + liberal*trust_gov + conservative*trust_gov + moderate*trust_gov + income + education + age + female + white + budget_difficult + democrat + republican, random = 1 | id, dat
                  +                   family ="

Please provide guidance as to what I am doing incorrectly.  I appreciate your help.

Thanks,

Grisenia