On Nov 7, 2011, at 10:58 AM, Sally Ann Sims wrote:
Hello,
I am working on fitting a logistic regression model to my dataset.
I removed the squared term in the second version of the model, but
my model output is exactly the same.
Model version 1: GRP_GLM<-glm(HB_NHB~elev
+costdis1^2,data=glm_1,family=binomial(link=logit))
summary(GRP_GLM)
Model version 2: QM_1<-glm(HB_NHB~elev
+costdis1,data=glm_2,family=binomial(link=logit))
summary(QM_1)
The call in version 2 has changed:
Call:
glm(formula = HB_NHB ~ elev + costdis1, family = binomial(link =
logit),
data = glm_2)
But I’m getting the exact same results as I did in the model where
costdis1 is squared.
Are you sure that you got output that correctly modeled the
costdis1^2? I would ahve guessed that you would have needed to use :
GRP_GLM<-glm(HB_NHB~elev+I(costdis1^2), data=glm_1,
family=binomial(link=logit))
?I
The "^" in model formulas is for composing interactions.
?formula
Any ideas what I might do to correct this? Thank you.
Sally
[[alternative HTML version deleted]]
And please post in plain text.
--
David Winsemius, MD
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.