Welcome to Highline BI348 Class Video Number 49.
If you want to download this workbook, BI348 Chapter Four,
and follow along, click on the link below the video.
In this video we're still talking all about
linear regression.
And in this video we want to talk
about this amazing function, Line S for line estimate,
or Line st for line straight.
And guess what?
This will return statistics that describe linear trend matching
known data points, that's our x and y in points,
by fitting a straight line using the least square method.
Now in this example we just have one independent variable, x
and one y.
So this is simple linear regression.
We're going to use it to calculate
a bunch of statistics.
Later we'll use the same function
with multiple regressions.
So we'll have multiple x's.
But here, we only have one x.
So watch this.
It can calculate slope, standard error of the slope,
r squared, f-- which we haven't talked about yet--
SSR, which we have talked about, SSE, degrees of freedom,
standard error of the estimate, standard error
of the intercept-- which we haven't talked
about yet-- and the intercept.
And it will calculate all of these in one swoop.
So watch this.
You have to highlight two columns and five row.
Now, how did I know how many columns?
You highlight number of columns one more
than there's independent variables.
So we have one independent variable,
so I'm highlighting one plus one extra one.
And then you always highlight five
if you want the extra statistics, because it
will always deliver five rows.
And notice I've highlighted a bunch of cells
in advance, because the function will
deliver 10 different statistics all at once.
That means it's a function that delivers an array of answers.
So this is an array function.
And in this class we've seen a few different array functions,
like frequency, for example.
I'm going to try this.
Line estimate, the known y's.
Control Shift, down arrow, and then Control
backspace to jump back to the active cell, comma, known x's,
Control Shift down arrow, Control backspace.
Now if you wanted just slope and intercept,
you could actually do that and highlight just two cells.
But I want to hit comma.
And I want to tell it to calculate b normally,
so I'm going to double-click on this.
Notice we're telling it set equal to 0
or calculate normally with either putting false or true.
There's no problem.
You can double click the true and put it in.
I always put a 1 for true and a 0 for false.
So I'm going to put 1, comma.
And then the next argument is, false do not
return additional regression statistics.
That means it won't return row 2, 3, 4, and 5.
That's just when you want the slope and the intercept.
But I don't want that.
I want true.
I want to return additional regression statistics.
So I'm going to put a 1, or true, close parentheses.
Now this is an array function, so to enter it and have
it deliver 10 different values, you have to use Control Shift
and Enter.
Now watch this.
If I just hit Enter, it gives me just 1.
If I were to do Control Enter and forget the shift,
it would do that, F2.
Another common mistake is people forget
to put the extra arguments there, close parentheses.
So even if you remember Control Shift Enter,
it delivers just the slope and the intercept, F2.
But I want to do it correctly.
So comma 1, comma 1, and then Control Shift and Enter.
And there we go.
10 statistics all at once.
There's the slope.
There's the intercept.
These are actually the standard deviations
of these two statistics here, which we'll look at later.
There's our r-squared, standard error
of the estimate, our f-- which we haven't talked
about-- our degrees of freedom, which we did last video, SSE,
and SSR.
Now as always, when you enter an array function,
you've got to look up and see the curly brackets.
The curly brackets are Excel saying,
I understood that you entered this as an array.
If you were to try and change this array, for example,
right-click Insert, you cannot change part of array.
If you tried to delete an individual cell, same message.
So in this video, we saw how to use the amazing Line
S to deliver 10 different statistics all at once.
And we will see this function later in multiple regression.
Actually, next video we'll get to do multiple regression.
All right.
We'll see you next video.