# 4.3 Fitting linear models to data  (Page 3/14)

 Page 3 / 14

Given data of input and corresponding outputs from a linear function, find the best fit line using linear regression.

1. Enter the input in List 1 (L1).
2. Enter the output in List 2 (L2).
3. On a graphing utility, select Linear Regression (LinReg).

## Finding a least squares regression line

Find the least squares regression line using the cricket-chirp data in [link] .

1. Enter the input (chirps) in List 1 (L1).
2. Enter the output (temperature) in List 2 (L2). See [link] .
 L1 44 35 20.4 33 31 35 18.5 37 26 L2 80.5 70.5 57 66 68 72 52 73.5 53
3. On a graphing utility, select Linear Regression (LinReg). Using the cricket chirp data from earlier, with technology we obtain the equation:
$T\left(c\right)=30.281+1.143c$

Will there ever be a case where two different lines will serve as the best fit for the data?

No. There is only one best fit line.

## Distinguishing between linear and nonlinear models

As we saw above with the cricket-chirp model, some data exhibit strong linear trends, but other data, like the final exam scores plotted by age, are clearly nonlinear. Most calculators and computer software can also provide us with the correlation coefficient    , which is a measure of how closely the line fits the data. Many graphing calculators require the user to turn a ”diagnostic on” selection to find the correlation coefficient, which mathematicians label as $\text{\hspace{0.17em}}r\text{\hspace{0.17em}}$ The correlation coefficient provides an easy way to get an idea of how close to a line the data falls.

We should compute the correlation coefficient only for data that follows a linear pattern or to determine the degree to which a data set is linear. If the data exhibits a nonlinear pattern, the correlation coefficient for a linear regression is meaningless. To get a sense for the relationship between the value of $\text{\hspace{0.17em}}r\text{\hspace{0.17em}}$ and the graph of the data, [link] shows some large data sets with their correlation coefficients. Remember, for all plots, the horizontal axis shows the input and the vertical axis shows the output.

## Correlation coefficient

The correlation coefficient is a value, $\text{\hspace{0.17em}}r,$ between –1 and 1.

• $r>0\text{\hspace{0.17em}}$ suggests a positive (increasing) relationship
• $r<0\text{\hspace{0.17em}}$ suggests a negative (decreasing) relationship
• The closer the value is to 0, the more scattered the data.
• The closer the value is to 1 or –1, the less scattered the data is.

## Finding a correlation coefficient

Calculate the correlation coefficient for cricket-chirp data in [link] .

Because the data appear to follow a linear pattern, we can use technology to calculate $\text{\hspace{0.17em}}r\text{\hspace{0.17em}}$ Enter the inputs and corresponding outputs and select the Linear Regression. The calculator will also provide you with the correlation coefficient, $\text{\hspace{0.17em}}r=0.9509.\text{\hspace{0.17em}}$ This value is very close to 1, which suggests a strong increasing linear relationship.

Note: For some calculators, the Diagnostics must be turned "on" in order to get the correlation coefficient when linear regression is performed: [2nd]>[0]>[alpha][x–1], then scroll to DIAGNOSTICSON.

## Fitting a regression line to a set of data

Once we determine that a set of data is linear using the correlation coefficient, we can use the regression line to make predictions. As we learned above, a regression line is a line that is closest to the data in the scatter plot, which means that only one such line is a best fit for the data.

#### Questions & Answers

find general solution of the Tanx=-1/root3,secx=2/root3
find general solution of the following equation
Nani
the value of 2 sin square 60 Cos 60
0.75
Lynne
0.75
Inkoom
when can I use sin, cos tan in a giving question
depending on the question
Nicholas
I am a carpenter and I have to cut and assemble a conventional roof line for a new home. The dimensions are: width 30'6" length 40'6". I want a 6 and 12 pitch. The roof is a full hip construction. Give me the L,W and height of rafters for the hip, hip jacks also the length of common jacks.
John
I want to learn the calculations
where can I get indices
I need matrices
Nasasira
hi
Raihany
Hi
Solomon
need help
Raihany
maybe provide us videos
Nasasira
Raihany
Hello
Cromwell
a
Amie
What do you mean by a
Cromwell
nothing. I accidentally press it
Amie
you guys know any app with matrices?
Khay
Ok
Cromwell
Solve the x? x=18+(24-3)=72
x-39=72 x=111
Suraj
Solve the formula for the indicated variable P=b+4a+2c, for b
Need help with this question please
b=-4ac-2c+P
Denisse
b=p-4a-2c
Suddhen
b= p - 4a - 2c
Snr
p=2(2a+C)+b
Suraj
b=p-2(2a+c)
Tapiwa
P=4a+b+2C
COLEMAN
b=P-4a-2c
COLEMAN
like Deadra, show me the step by step order of operation to alive for b
John
A laser rangefinder is locked on a comet approaching Earth. The distance g(x), in kilometers, of the comet after x days, for x in the interval 0 to 30 days, is given by g(x)=250,000csc(π30x). Graph g(x) on the interval [0, 35]. Evaluate g(5)  and interpret the information. What is the minimum distance between the comet and Earth? When does this occur? To which constant in the equation does this correspond? Find and discuss the meaning of any vertical asymptotes.
The sequence is {1,-1,1-1.....} has
circular region of radious
how can we solve this problem
Sin(A+B) = sinBcosA+cosBsinA
Prove it
Eseka
Eseka
hi
Joel
yah
immy
June needs 45 gallons of punch. 2 different coolers. Bigger cooler is 5 times as large as smaller cooler. How many gallons in each cooler?
7.5 and 37.5
Nando
how would this look as an equation?
Hayden
5x+x=45
Khay
find the sum of 28th term of the AP 3+10+17+---------
I think you should say "28 terms" instead of "28th term"
Vedant
the 28th term is 175
Nando
192
Kenneth
if sequence sn is a such that sn>0 for all n and lim sn=0than prove that lim (s1 s2............ sn) ke hole power n =n