[R] Error in predict.lm() for models with no intercept?

isabella at ghement.ca isabella at ghement.ca
Wed Sep 17 00:06:21 CEST 2014


 

	Hi everyone,  

	Could there be an error in the predict() function in R for models
without intercepts which include one or more predictors?  When using
the predict() function to obtain the standard errors of the fitted
values produced by a linear model (lm), the behaviour of the standard
errors seems to mirror that of models which include an intercept
(which should not happen).   

	Here is an attempt to produce standard errors (and hence confidence
bands) for the fitted values in a linear model with a single predictor
and no intercept using R code: 

	## simulate a response y and two predictors x and z  

	x 
	[[alternative HTML version deleted]]



More information about the R-help mailing list