Re: [R] Am failing on making lagged residual after regression

2004-03-09 Thread Prof Brian Ripley
If you have missing data in your data frame and want residuals for all observations, you need to use na.action=na.exclude, not the default na.omit. As for lag, its description says Description: Compute a lagged version of a time series, shifting the time base back by a given number

[R] Am failing on making lagged residual after regression

2004-03-08 Thread Ajay Shah
Folks, I'm most confused in trying to do something that (I thought) out to be mainstream and straightforward R. :-) Could you please help? I am doing an ordinary linear regression. My goal is: After a regression, to make residuals, and make a new variable which is the lagged residuals (lagged by