If two independent samples are obtained, then we can ask whether they may
have been drawn from two different underlying distributions.
First
generate a Data set n
= 50 Now plot
the data and a horizontal line at the mean plot(x,y) Calculate
the best fit model line and draw in the line fit.lm
= lm(y~x) Predict
yhats and construct confidence intervals for the slope
newx
= seq(min(x),max(x)) Get a plot of the results, for residuals vs fitted values, residuals vs independent values, a QQ plot for residuals, etc ...
