I came up with this code to calculate VIF for variables for each model I am evaluating
where x is
and where d1 is
where A,B,C and D are dataframes
My displayvif function does not work - it displays nothing
If i use
on 'models', i get what i want but the function won't display/create nothing.
Anyone know what is going on?
Code:
displayvif<-function(x){
for (i in 1:length(x))
vif(x[[i]])
}
Code:
models<-lapply(d1,function(data){lm(reformulate(termlabels=".",response=names(data)[1]),data)})
Code:
d1<-list(A,B,C,D)
My displayvif function does not work - it displays nothing
If i use
Code:
vif(x[[i]])
Anyone know what is going on?