Displaying 1 result from an estimated 1 matches for "outlm".
Did you mean:
outl
2004 Nov 08
1
plotting lm coeficients with their means
I am trying to write a function that will run a linear
model and plot the regression coeficients with their
corresponding means. I am having two problems. I can
get the plot with the function below, but I am having
trouble labeling the points.
function(y,x1,x2,x3,x4){
outlm<-lm(y~x1+x2+x3+x4)
imp<-as.data.frame(outlm$coef[-1])
meanvec<-c(mean(x1),mean(x2),mean(x3),mean(x4))
out<-list(imp,meanvec)
mf<-as.data.frame(out)
plot((mf),xlab="Impact",ylab="performance")
abline(h=mean(meanvec))
abline(v=mean(imp))
}
Problem #2: If I only in...