Displaying 1 result from an estimated 1 matches for "data025".
Did you mean:
data02
2008 Mar 28
0
How to extract the coefficients from the model
...t to
extract the vif values for x1 and x2 respectively as well as the regression
coefficients for x1 and x2. Because I then want to plug them in a next step
of the analysis. Thank you in advance! I am using the MASS package.
co<-0.25*sqrt(16)*sqrt(10)
sigma <- matrix(c(16,co,co,10),2,2)
data025<-mvrnorm(n=100,rep(0,2),sigma,empirical = TRUE)
x1<-data025[,1]
x2<-data025[,2]
eta<-rnorm(n=100,mean=0,sd=1)
y<-10-1.5*x1-0.25*x2+eta
f<-lm(y~x1+x2)
vif<-function(f)
UseMethod("vif")
vif.lm<-function(f){
V<-summary(f)$cov.unscaled
Vi<-crossprod(mo...