\begin{Schunk}
\begin{Sinput}
 ## Generate 100 cases
 N <- 100
 ## X is normally distributed with a mean of 0 and a sd of 10
 ## Y = intercept + b1*X + e
 ## intercept = 30
 ## b1 = 2
 ## e = N(0,5)
 X <- rnorm(N, 0, 10)
 Y <- 30 + 2*X + rnorm(N, 0, 5)
 plot(Y ~ X)
 summary(lm(Y ~ X))
\end{Sinput}
\begin{Soutput}
Call:
lm(formula = Y ~ X)

Residuals:
     Min       1Q   Median       3Q      Max 
-10.8138  -3.8952   0.0281   3.5089  11.5230 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 29.90855    0.54657   54.72   <2e-16 ***
X            1.99912    0.05414   36.93   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 5.46 on 98 degrees of freedom
Multiple R-squared:  0.933,	Adjusted R-squared:  0.9323 
F-statistic:  1364 on 1 and 98 DF,  p-value: < 2.2e-16
\end{Soutput}
\end{Schunk}
