Is there a way to estimate the standard error for the difference in
predicted probabilities obtained from a logistic regression model?
For example, this code gives the difference for the predicted
probability of when x2==1 vs. when x2==0, holding x1 constant at its
mean:
y=rbinom(100,1,.4)
x1=rnorm(100, 3, 2)
x2=rbinom(100, 1, .7)
mod=glm(y ~ x1 + x2, family=binomial)
pred=predict(mod, newdata=data.frame(cbind(x1=rep(mean(x1), 100),
x2)), type="response")
diff=unique(pred)[1]-unique(pred)[2]
diff
I know that predict() will output SE's for each predicted value, but
how do I generate a SE for the difference in those predicted values?
Thanks in advance!
Andrew Miles
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.