I have been working with logistic regression and would like to run out that reports several models ("blocks") so I can compare them.
I found apa.reg.table which creates exactly the kind of output I would like to see, but, alas, when I run glm models, I get error messages. No such error messages when I run a regression. I am especially interested in comparing these block models by the percentage change, which runs fine in a regular regression.
Questions:
- Is there any way I can run apa.reg.table with a logistic regression?
- If not, does anyone know of any packages or techniques that can be used to help me reach my objectives?
...In researching the problem, I ran the iris database:
data(iris)
...and then ran a series of four successive logistic regressions:
#Logistic regression models
MODEL_A<-glm(species~sepal.len, data=iris,, family=binomial())
MODEL_B<-glm(species~sepal.len+sepal.wid, data=iris, family=binomial())
MODEL_C<-glm(species~sepal.len+sepal.wid+petal.len, data=iris, family=binomial())
MODEL_D<-glm(species~sepal.len+sepal.wid+petal.len+petal.wid, data=iris, family=binomial())
apa.reg.table(MODEL_A,MODEL_B,MODEL_C,MODEL_D)
...but I receive the following error messages:
#Error in if (F.value < 0) stop("Your 'F.value' is not correctly specified.") :
# argument is of length zero
#In addition: Warning messages:
#1: Unknown or uninitialised column: 'r.squared'.
#2: Unknown or uninitialised column: 'p.value'.
...it runs fine in a regular regression analysis:
#regression models:
MODEL_B2<-lm(sepal.len~sepal.wid, data=iris)
MODEL_C2<-lm(sepal.len~sepal.wid+petal.len, data=iris)
MODEL_D2<-lm(sepal.len~sepal.wid+petal.len+petal.wid, data=iris)
#create table with regression models--no error messages:
apa.reg.table(MODEL_B2,MODEL_C2,MODEL_D2)
Any help would be greatly appreciated.