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
Here are a couple of examples.
# residuals not normal
n - 100;
x = seq(n)
y = 10 + 10 *x + 20 * rchisq(n,df=2)
non_normal_lm = lm(y~x)
#non-constant variance
n - 100;
x = seq(n)
y = 100 + 3 * x + rnorm(n,0,3) * x;
het_var_lm = lm(y~x)
#For each of these try:
plot(non_normal_lm)
plot(het_var_lm)
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
Thank you both for your responses and the hints for help!
Greetings,
Friedericksen
Friedericksen Hope wrote:
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
4 matches
Mail list logo