[R] Simulate residuals with different properties for a linear model (regression)

Friedericksen Hope friedericksen.hope at gmail.com
Mon Jul 20 20:16:50 CEST 2009


Hey guys,

for educational purposes I wonder if it is possible to simulate
different data sets (or specifically residuals) for a linear regression.
I would like to show my students residuals with different means,
variances and distributions (normal, but also not normal) in the plots
created with the plot command for a lm-object. In addition it would be
nice to simulate although influencal values (high cooks distance and
leverage)

lm.results <- lm(y~x,data)
plot(lm.results)

Is there an easy way to do this? Or can this be done at all (and if yes,
any hints?:-)

Thanks and Greetings!
Friedericksen




More information about the R-help mailing list