This section is a continuation of section 2.6, Exploring Data: Linear Models and Scatter Plots. Please see that section for the introductory information on how to enter data into your calculator, create scatter plots, and perform regression.

Model | Calculator Command | Equation |
---|---|---|

Linear | LinReg(ax+b) L_{1}, L_{2} |
y = ax + b |

Quadratic, At least 3 points required |
QuadReg L_{1}, L_{2} |
y = ax^{2} + bx + c |

Cubic, At least 4 points required |
CubicReg L_{1}, L_{2} |
y = ax^{3} + bx^{2} + cx + d |

Quartic, At least 5 points required |
QuartReg L_{1}, L_{2} |
y = ax^{4 }+ bx^{3} + cx^{2} + dx + e |

Logarithmic | LnReg L_{1}, L_{2} |
y = a + b ln x |

Exponential | ExpReg L_{1}, L_{2} |
y = a b^{x} |

Power | PwrReg L_{1}, L_{2} |
y = a x^{b} |

Logistic (TI83 only) | Logistic L_{1}, L_{2} |
y = c / ( 1 + a e^{-bx} ) |

Sinusoidal (TI83 only), At least 4 points required |
SinReg L_{1}, L_{2} |
y = a sin (bx + c) + d |

With the TI-83, you may store the regression equation directly into a y-variable
by specifying the y-variable after the lists where your data is stored. Example:
"LnReg L_{1}, L_{2}, y_{1}" would compute
the logarithmic model and save the result into y_{1}.

Model | Calculator Command | Equation |
---|---|---|

Linear | LINR | y = a + bx |

Quadratic, At least 3 points required |
P2REG | You are given a list of coefficients. These coefficients are in standard form, so the first coefficient will be the leading cofficent, and the last coefficient in the list will be the constant. |

Cubic, At least 4 points required |
P3REG | |

Quartic, At least 5 points required |
P4REG | |

Logarithmic | LNR | y = a + b ln x |

Exponential | EXPR | y = a b^{x} |

Power | PWRR | y = a x^{b} |

Notice that things are a little different for the TI-85 when it comes to polynomial regression. The
results are not given in equation form with individual coefficients, but are given as a list of
coefficients and stored in the variable PRegC. If PRegC = { 3, 2, -1, 5 }, then the regression
equation would be y = 3x^{3} + 2x^{2} - x + 5. DRREG will correctly draw the regression equation
even if polynomial regression is used.

The concept behind fitting a model to data is to find the model that has the smallest deviation from the actual data. This deviation is the predicted (estimated by the model) y-value minus the actual y-value. These deviations are all squared to make sure they don't cancel each other out, and then added. We're then looking for the smallest sum of the squared deviations, that is the "Least Squares" model.

Note problems 35 and 36 will be much easier if you follow the instructions here than the instructions in the book.

Assume that you have entered the x-values into list 1 and the y-values into list 2. You have
computed whichever model you're working with and have saved the resulting equation into y_{1}.

The predicted y-values can be found by evaluating y_{1} at each x-value (list 1): ` y _{1}(L_{1})`

The sum of the squared deviations can be found using the following command:

sum ( ( L_{2}- y_{1}(L_{1}) )^{2})

- The "sum" command can be found under the LIST key. After hitting
2
^{nd}Stat to get the List menu, arrow right to Math, and choose sum. - The L
_{1}and L_{2}commands can be obtained by hitting 2^{nd}1 and 2^{nd}2. - The y-variables like y
_{1}can be found on the TI-82 under the Y-VARS key (2^{nd}VARS), and on the TI-83 under the VARS key, and then arrow right to the Y-Vars option.

The model with the smallest sum of the squared deviations is the best model.

With the TI-85, this is a *much* harder task to accomplish. Calculate the regression equation as
normal, then enter the following expression to find the sum of the squares (extra spaces inserted
for readability).

sum seq( ( yStat(x) - fcsty xStat(x) )^{2}, x, 1, dimL xStat, 1)

- sum, seq, and dimL can be found under the LIST key, and the OPS sub menu.
- The xStat and yStat can be found under the LIST key, and the NAMES sub menu. They can also be found under the STAT key and the VARS sub menu, but it is probably easier from list since that's where the rest of the commands are.
- The fcsty can be found under the CATALOG by pressing the Alpha and then F keys.

If someone can find an easier way on the TI-85, then please let me know. You may want to write a short program with that command in it.

We mentioned the correlation coefficient, r, back in section 2.6. Back then, it was only for linear
models. We can also compute (well, we'll let the calculator compute) the value for r and r^{2} for
nonlinear models also.

Back in section 2.6, we said that the closer the value of r was to 1 or -1, the better the model fit
the data. For nonlinear models, we often ignore the value of r and look at the value of r^{2}. The
value of r^{2} can be found by simply squaring r.

There is always variation in your data. That is, never (almost) is all of the data exactly the same.
The interpretation of r^{2}, from a statistical point of view is the percent of the variation that can be
explained by the model. The higher the value of r-squared, the better the model explains the
data.

The TI-85 does not calculate the value of r^{2} for polynomial (quadratic, cubic, or quartic models).
For the other models, you may have to square the correlation (corr variable). The variables
necessary to easily compute the value the correlation coefficient aren't computed when doing
polynomial regression, so finding r or r^{2} for polynomial regression are going to be extremely
difficult for the TI-85 users. I suggest you find a TI-82 or TI-83 and borrow it long enough to do
that particular regression model.

The model with the highest value for r^{2} is the best model.