Created
December 2, 2014 23:01
-
-
Save Oreotrephes/c0c3780a06ded1a5dc6e to your computer and use it in GitHub Desktop.
At-a-glance coefficient table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| summaryfunction2<-function(x,y){ | |
| signs<-substr(as.character(sign(x)),1,1) | |
| signs[signs=="1"]<-"+" | |
| significance<-cut(abs(y), c(0, 0.001, 0.01, 0.05, Inf), labels=c("***", "**", "*", ""), right=FALSE) | |
| paste(signs, significance) | |
| } | |
| process<-function(lm){ | |
| coef<-data.frame(summary(lm)$coefficients)[-1,-c(2,3)] | |
| coef$comb<-summaryfunction2(coef$Estimate,coef$Pr...t..) | |
| vec<-t(coef[3]) | |
| vec<-data.frame(vec) | |
| vec$dependent<-as.character(lm$terms[[2]]) | |
| vec | |
| } | |
| lm1<-lm(Sepal.Length~Petal.Length+Petal.Width,data=iris)) | |
| lm2<-lm(Sepal.Length~Petal.Length+Petal.Width,data=iris)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment