variance inflation factors: `vif.mer` verus group/factor level `vif()` Imagine we have a data set with a y, x z and group1 and group2.
We want to do this model 
library(lme4)
model <- glmer(y ~ x + z + (1|group1/group2), data = data)

We want to check colinearity between x and z, so we calculate variance inflation factors with (taken from here):
vif.mer <- function (fit) {
## adapted from rms::vif
v <- vcov(fit)
nam <- names(fixef(fit))
## exclude intercepts
ns <- sum(1 * (nam == "Intercept" | nam == "(Intercept)"))
if (ns > 0) {
v <- v[-(1:ns), -(1:ns), drop = FALSE]
nam <- nam[-(1:ns)] }
d <- diag(v)^0.5
v <- diag(solve(v/(d %o% d)))
names(v) <- nam v }

vif.mer(model)

Lets say it is <2, however when we do 
individual gifs for each group  e.g.
vif(data[data$group2 == 1 ,])
vif(data[data$group2 == 2 ,])
.....
vif(data[data$group2 == 20 ,])

We get gifs what range from 1.1 to over 10.
How do we interpret this? Should we be concerned about colinearity, it seems strange to get such variable results?
 A: This has a nice geometric explanation.  A VIF of $1$ indicates there is no detectable linear relationship among the regressors, while a large VIF indicates a tight linear relationship.  The question therefore asks

How is it possible for data to appear uncorrelated while subsets of the data are strongly correlated?

Answer: create the subsets first.
For example, consider two regressors $X$ and $Y$ divided into groups wherein $X$ and $Y$ are strongly related to each other, as in this picture:

The groups are distinguished by color.
The correlation among the entire collection of points is low (essentially zero in this example), while the correlation coefficients within six of these groups are either larger than $98\%$ or smaller than $-98\%$, indicating extremely high correlation (and leading to very high VIFs if each group were used alone in a regression).
It should be evident there's nothing to worry about.  After all, you could take any point cloud (representing a set of regressor values) and find several points--maybe a large number of them--that come close to lining up.  If you were to make that a group, you could create a regression based on them with a high VIF.  But, when there are other points in the model lying far from such point collections, the usual problems associated with high VIFs do not occur.

Here is the R code used to create these data, showing how they were built up from individual strongly-correlated groups:
X <- expand.grid(Group=1:7, X=seq(-10, 10, length.out=20))
X$Y <- X$X*(4 - X$Group) + rnorm(20) + X$Group
plot(X$X, X$Y, col=terrain.colors(7)[X$Group], pch=16, xlab="X", ylab="Y")

