Interest in learning or even seeing the process of calculating the

With just these few commands in R

gnrnd4( key1=624710806, key2=6120300706, key3=2500010 ) L1 L2 summary(L1) summary(L2) lm_L2L1 <- lm(L2~L1) lm_L2L1 cor(L1,L2) plot(L1,L2) abline(lm_L2L1)

Figure 1 shows the console output of those commands.

Among other values displayed, Figure 1 gives us the information to say that the regression equation is

Figure 2 shows the resulting plot where we can see the spread of the points along the

The goal of this page is to define and then walk through the computations that had to be done to find the

We start with a few definitions.

- The data is in
**(x,y)**pairs. - There are
**n**pairs of values. - The regression equation has the form
**y = a + bx**, where**a**is the**intercept**and**b**is the**coefficient**of the independent variable**x**. - Define
**Sum**to be the_{x}**sum of the x**values. - Define
**Sum**to be the_{y}**sum of the y**values. - Define
**Sum**to be the_{x2}**sum of the squares of the x**values. - Define
**Sum**to be the_{xy}**sum of the product of the x and y**values. - Define
**Sum**to be the_{y2}**sum of the squares of the y**values.

`lm( )`

`cor( )`

©Roger M. Palay Saline, MI 48176 November, 2015