In the course of exploring response prediction, I stumbled upon a  
small discrepancy between the CIs produced by predict.lm() and  
all.effects()

require(mlmRev)
require(effects)
hsb.lm <- lm(mAch ~ minrty * sector, Hsb82)
hsb.new <- data.frame(
     minrty = rep(c('No', 'Yes'), 2),
     sector = rep(c('Public', 'Catholic'), each = 2))
hsb.eff <- all.effects(hsb.lm)
cbind(
     hsb.new,
     predict(hsb.lm, hsb.new, interval = 'confidence', type =  
'response')
)
# the following lower and upper bounds differ starting with the  
fourth decimal place
data.frame(
     hsb.new,
     fit = hsb.eff[[1]]$fit,
     lwr = hsb.eff[[1]]$lower,
     upr = hsb.eff[[1]]$upper
)

Is this due to rounding or algorithm?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to