Created
December 4, 2012 00:19
-
-
Save cdesante/4199311 to your computer and use it in GitHub Desktop.
apsrtable
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
doInstall <- TRUE | |
toInstall <- c("apsrtable") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
#http://cran.r-project.org/web/packages/apsrtable/apsrtable.pdf | |
library(apsrtable) | |
X1 <- rnorm(1000) | |
X2 <- rnorm(1000) | |
X3 <- rnorm(1000) | |
X4 <- rnorm(1000) | |
#Create a relationship to Model: | |
Y <- X1 + 1.8*X2 -.12*X3 + 1.8*X4 + rnorm(1000) | |
Model.1 <- lm(Y ~ X1 + X2) | |
Model.2 <- lm(Y ~ X1 + X3) | |
Model.3 <- lm(Y ~ X1 + X2 + X3) | |
Model.4 <- lm(Y ~ X1 + X2 + X3 + X4) | |
apsrtable(Model.1, Model.2, Model.3, Model.4, model.names=c("Model 1" , "Second Try", "Model 3", "My Fourth Model")) | |
apsrtable(Model.1, Model.2, Model.3, Model.4, lev=.30, | |
model.names=c("Model 1" , "Second Try", "Model 3", "My Fourth Model"), | |
coef.names=c("Intercept", "Some Variables", "That Might", "Be Of", "Interest to You")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment