YouTube transcript (iAgYLRy7e20) — Transcript
Full transcript
- 0:02[Music]
- 0:17hello thanks for watching and welcome to
- 0:20the next video in my series on basic
- 0:22statistics now as usual a few things
- 0:25before we get started number one if
- 0:27you're watching this video because you
- 0:28are struggling in a class right now I
- 0:31want you to stay positive and keep your
- 0:33head up if you're watching this it means
- 0:35you've accomplished quite a bit already
- 0:37you're very smart and talented but you
- 0:39may have just hit a temporary rough
- 0:41patch now I know with the right amount
- 0:43of hard work practice and patience you
- 0:46can work through it I have faith in you
- 0:49many other people around you have faith
- 0:51in you so so should you number two
- 0:55please feel free to follow me here on
- 0:57YouTube on Twitter on Google+ or on
- 1:01LinkedIn that way when I upload a new
- 1:03video you know about it and it's always
- 1:06nice to connect with my viewers online
- 1:08I'll feel that life is much too short
- 1:10and the world is much too large for us
- 1:12to miss the chance to connect when we
- 1:14can number three if you like the video
- 1:17please give it a thumbs up share it with
- 1:20classmates or colleagues or put it on a
- 1:22playlist that does encourage me to keep
- 1:24making them for you on the flip side if
- 1:27you think there's something I can do
- 1:28better please leave a instructive
- 1:30comment below the video and I will take
- 1:32those ideas into account when I make new
- 1:35ones and finally just keep in mind that
- 1:37these videos are meant for individuals
- 1:39who are relatively new to Stats so I'm
- 1:42just going over basic concepts and I
- 1:45will be doing so in a slow deliberate
- 1:48manner not only do I want you to know
- 1:51what is going on but also why and how to
- 1:55apply it so all that being said let's go
- 1:58ahead and get started
- 2:02so this video is the next in our series
- 2:04about simple linear regression in our
- 2:06last video we talked about the very
- 2:08basics of regression first we discussed
- 2:12what residuals are and then we learned
- 2:14about the sum of squares of those
- 2:16residuals lastly we talked about how a
- 2:19regression model is actually a
- 2:21comparison to a special model where the
- 2:24independent variable does not even exist
- 2:27and we just use the mean of the
- 2:29dependent
- 2:30variable so in this video we will talk
- 2:33about some of the nuts and bolts of
- 2:34regression I will introduce some basic
- 2:37terminology and Concepts that will carry
- 2:39you through your work using regression
- 2:42we will talk about how regression is
- 2:44related to the algebra of lines and
- 2:47discuss General patterns to look for on
- 2:49Scatter Plots now there are no formulas
- 2:52or calculations in this video the goal
- 2:54is to help better prepare you for
- 2:56interpreting regression analysis when it
- 2:59is performed if you are new to
- 3:01regression or are still trying to figure
- 3:03out exactly what it even is this video
- 3:06is for you so sit back relax and let's
- 3:09go ahead and get to
- 3:13work so simple regression is part of a
- 3:16special area of Statistics called by
- 3:19variate statistics of course by variate
- 3:21means two variables now in our previous
- 3:25videos we talked about correlation and
- 3:28we also talked about a Nova now if
- 3:31correlation and an NOA got together and
- 3:34had a child a very scary thought I know
- 3:38that child would be simple linear
- 3:41regression because regression shares
- 3:43trades with correlation and it shares
- 3:46traits with Anova now the sharing of all
- 3:49of those traits will become more
- 3:51apparent as we get further into
- 3:53regression but for now just going to
- 3:55take my word for it now correlation and
- 3:58regression also have something else in
- 4:00common and that is that those data
- 4:03points are plotted on a scatter plot or
- 4:06a coordinate plane so for both
- 4:09correlation and regression we have
- 4:10variable one and we have variable two
- 4:13and then we plot where each variable
- 4:15meets and we get a data point now of
- 4:17course our samples will have more than
- 4:19one data point so we'll populate it with
- 4:21some more points now the relationship
- 4:23between variable one and variable two is
- 4:25special in this case dealing with
- 4:27regression so we can say it like this
- 4:30the value of one variable is a function
- 4:33of the other variable so in this case
- 4:36the value of variable two is a function
- 4:39of the value of variable
- 4:41one we can say it like this the value of
- 4:44y is a function of X so y equal F ofx so
- 4:50we will either choose randomly or be
- 4:52given a value for x we will put that
- 4:55into some function and then it will
- 4:57generate a value for y
- 5:00but the value for y is always dependent
- 5:03on the value of
- 5:05x so we can say it like this the value
- 5:08of the dependent variable in this case Y
- 5:11is a function of the independent
- 5:13variable in this case the variable X now
- 5:16remember in regression the whole idea is
- 5:19to form a line through our data points
- 5:22that minimizes the residual sum of
- 5:25squares but before we can really learn
- 5:27about that we have to quickly review the
- 5:29basic
- 5:30of the algebra of
- 5:33lines so I know you don't really want to
- 5:35go back to algebra but you'd be
- 5:37surprised how many students I've worked
- 5:38with over the years that take stats
- 5:40they're sophomore junior year of college
- 5:42they haven't had algebra in five six
- 5:44seven years and they forget some of this
- 5:47stuff so just on one slide going to
- 5:49quickly review the algebra of lines now
- 5:52the most important thing to remember in
- 5:54this case is the slope intercept form of
- 5:57a line because that is basically
- 6:00how a regression line is stated so
- 6:03remember that y = mx plus b is the slope
- 6:07intercept form of a line and it's called
- 6:09that because it has two real components
- 6:12the slope and The Intercept so X in this
- 6:17case is some random variable that we
- 6:18either Choose Or we are given in the
- 6:21problem m in the slope intercept form is
- 6:25the slope of the line This represents
- 6:28you've also probably seen it written as
- 6:30rise over run but X is the random
- 6:33variable and M is the slope now B is the
- 6:37Y intercept is where the line crosses
- 6:39the Y AIS so wherever our line is on
- 6:43this graph wherever it crosses the Y AIS
- 6:46that is our Y
- 6:47intercept now the Y intercept has a
- 6:50couple of special properties the Y
- 6:52intercept is where x equals z so if you
- 6:57think about all the points on the Y AIS
- 6:59they all sound like this 02 05 010 0 -2
- 7:0705 Etc so it's always where the value of
- 7:11x is zero so every point on the Y AIS
- 7:16looks like this 0 comma y now let's take
- 7:20an example so we'll have this equation y
- 7:23= 2x + 3 now look at that equation and
- 7:26then superimpose it on top of the slope
- 7:29inter intercept form of a line we can
- 7:31learn a lot about this equation the
- 7:33first thing we can learn is that the
- 7:35slope is two so we have 2X + 3 over here
- 7:39on the left we have mx + b so 2 is where
- 7:42the m is therefore the slope is 2 now if
- 7:46we write it as a fraction that's 2 over
- 7:49one because we don't write the one when
- 7:50we write whole numbers like that so in
- 7:53terms of rise over run it's 2 over
- 7:56one now let's find the Y inter intercept
- 8:00so we know that the Y intercept is
- 8:02wherever X is zero so we can substitute
- 8:050 in for x and then calculate the value
- 8:08of y so Y = 2 * 0 + 3 so y = 3 so we
- 8:14have the point of The Intercept is the
- 8:16point
- 8:1703 so maybe it's about right there where
- 8:20the dot is now my graph here is not
- 8:23proportionally correct so don't go off
- 8:26how the graph looks just sort of take
- 8:28into account what I'm writing on the
- 8:30graph now of course to graph a line we
- 8:32have to have at least two points let's
- 8:35go ahead and figure out a second point
- 8:36and luckily this is easy to do we can
- 8:39just pick any random value for x and
- 8:41then calculate y so let's choose x = 1
- 8:44so we'll substitute one in where X is
- 8:47and we'll go and calculate the value of
- 8:48y so 2 * 1 is 2 + 3 so 2 + 3 is 5 so the
- 8:54second point on our graph will be the
- 8:57point 15 now we can go ahead and graph
- 9:01our
- 9:01line now remember our slope was 2 over 1
- 9:05so if this were graphed properly we
- 9:08could go up two and over one now
- 9:12remember they're both positive so two is
- 9:15upward and one is to the right because
- 9:17they're both positive and we would end
- 9:19up at another point on our line so this
- 9:23is a basic overview of the algebra of
- 9:25lines because regression lines when you
- 9:28actually do them in a stat software
- 9:30package come out in this
- 9:35form now they don't come out in exactly
- 9:37that form but they are related so let's
- 9:40go ahead and show that relationship so
- 9:42the slope intercept is y = mx + b now
- 9:46the overall regression model for the
- 9:48entire population we are considering
- 9:51looks like this y = beta Sub 0 plus beta
- 9:56sub 1 x + e so don't freak out this is
- 10:01essentially the same thing you see over
- 10:04on the left now remember as in many
- 10:07areas of stats there is this very large
- 10:10overall population that we really don't
- 10:13know everything there is to know about
- 10:16it because maybe we can't so therefore
- 10:18we have to use sample data to estimate
- 10:22it now if we had the population
- 10:25available to us this is what the
- 10:27regression model would look like
- 10:30now how does it relate to over here on
- 10:31the left so I color coded it as well so
- 10:34you can see the relationship so beta Sub
- 10:360 is the Y intercept of the population
- 10:40parameter so you can see on the left
- 10:42it's B and over here on the right it's
- 10:45beta Sub
- 10:470 Now Beta sub one is the same thing as
- 10:50the slope of the population parameter so
- 10:53beta sub 1X over here on the right
- 10:56corresponds to MX over here on the left
- 11:00and then e is the error term in
- 11:03regression it's the Unexplained
- 11:05variation in our y variable so I don't
- 11:09want to get ahead of myself here but the
- 11:11beta Sub 0 + B beta sub 1X will explain
- 11:16part of the variation and then what's
- 11:19left will be error or unexplained
- 11:22variation now when we actually do simple
- 11:25linear regression we write it like this
- 11:27the expected value of y equal beta Sub 0
- 11:32+ beta sub 1 x now all you really need
- 11:36to know at this point is that this is
- 11:38pretty much the exact same thing as y =
- 11:41mx plus b up here on the top left so
- 11:46what is the expected value of y well
- 11:49it's the mean or the expected value of y
- 11:53for a given value of x so whatever X we
- 11:57choose or or given
- 12:00the expected value of y is where we
- 12:02expect that to intersect in our graph
- 12:06now again this will become more apparent
- 12:07as we go but this is how we actually
- 12:10write the simple regression
- 12:14model now the expected value is the mean
- 12:18so what does that actually well mean so
- 12:22if we have a coordinate plane here where
- 12:23we have X and Y AIS and we pick a value
- 12:27for x so maybe here sort of in the
- 12:30middle well that corresponds to a value
- 12:33of y and that's our data point maybe
- 12:35right
- 12:37here but that's the expected value of y
- 12:41it's really not that simple there's
- 12:44actually a distribution of Y's for that
- 12:48given X so remember our regression model
- 12:51is not going to be perfect so any
- 12:54expected value of y we come up with is
- 12:57at best going to be an approximation
- 13:00so when we say the expected value what
- 13:01we mean is that it's the mean of a small
- 13:05distribution for that y so it can be
- 13:09fairly narrow like this you can see that
- 13:12our distribution of y's Falls in a
- 13:14narrow band or it can be the exact same
- 13:18point so this exact same point with the
- 13:22expected value of y could be much
- 13:25wider like that now obviously in
- 13:28regression we want to have the situation
- 13:30like is over here on the left so we want
- 13:33to have the expected value of our y's to
- 13:35be in sort of a narrower range a narrow
- 13:38distribution than we do over here on the
- 13:41right but just remember the expected
- 13:44value of y is really the mean the mean
- 13:48of a distribution of those y values now
- 13:51this will become more important as we
- 13:53get into more complex topics about
- 13:55regression but I just want to point out
- 13:57that the value of y isn't really a point
- 14:01it's the mean of a distribution around
- 14:03the
- 14:06Y's now regression lines can take three
- 14:09General forms so here we have our
- 14:11expression up here on the left or
- 14:13equation up here on the left so expected
- 14:15value of y = beta Sub 0 + beta sub 1 * X
- 14:20so we can have the first case so it
- 14:22looks like this the expected value of y
- 14:25equal beta Sub 0 + 0 * X well what is
- 14:32the zero in this case well that's where
- 14:34the beta sub one is so what is that
- 14:37saying well that's saying that the slope
- 14:40is zero but if we go ahead and multiply
- 14:44this out we end up with just expected
- 14:46value of y equals beta Sub 0 because
- 14:50everything to the right of that is 0
- 14:53because of the multiplication so on our
- 14:55graph if our slope is zero it looks like
- 14:59like this the line is flat that is a
- 15:02line with the slope of zero so the slope
- 15:06b sub1 or beta sub one is
- 15:10zero the second type might look like
- 15:12this expected value of y equal beta Sub
- 15:160 plus beta sub 1 x now notice that the
- 15:20slope the beta sub 1 is positive so it
- 15:25looked like this so the slope beta sub 1
- 15:28is is a positive so our line goes from
- 15:31the lower left upward to the right now
- 15:35the other General type looks like this
- 15:37the expected value of y = beta Sub 0
- 15:40minus beta sub 1 * X in this case our
- 15:44slope the beta sub one is negative so it
- 15:48might look like this where our line goes
- 15:51from the top left down to the lower
- 15:53right so again these are General
- 15:55patterns that are based on the sign and
- 16:00the value of beta sub 1 because beta sub
- 16:031 is the same thing as the slope so mx +
- 16:07b this is beta sub 1 * X beta sub 1 is
- 16:12the slope so our lines might sort of
- 16:14form a general pattern based on the
- 16:16value of beta sub
- 16:20one so if we actually knew the
- 16:23population parameters beta Sub 0 and
- 16:25beta sub 1 we could use the simple
- 16:28linear regression equation that looks
- 16:30like this that we already saw but in
- 16:33reality we almost never have the
- 16:34population parameters therefore we will
- 16:37estimate them using sample data when
- 16:39using sample data we have to change our
- 16:41equation a little bit it looks like this
- 16:45now the Y with the little thing on top
- 16:48is pronounced y hat and it is the point
- 16:52estimator of the expected value of
- 16:56y so y hat is the mean
- 16:59value of y for a given value of x so
- 17:04just like other cases in stats where
- 17:06we're using sample data we write the
- 17:08equations a bit differently so all we do
- 17:10is use lowercase b where we have the
- 17:13betas in the top equation and of course
- 17:15we have y hat versus the expected value
- 17:18of y now in functional terms they act
- 17:22the same way we just write it this way
- 17:25to acknowledge that we are using sample
- 17:28data
- 17:31so here is our same graph but now we
- 17:34write it with Y hat so in this case
- 17:36we're using sample data but the basic
- 17:39idea is the same so y hat is the mean of
- 17:44the expected values of Y for any given
- 17:47value of x otherwise it's the exact same
- 17:53concept so let's look at this in the
- 17:55context of a problem now this data or
- 17:58this graph is from our first video where
- 18:01we had the dollar amount of tips like a
- 18:04waiter or waitress received in a
- 18:06restaurant but we didn't have the
- 18:08matching amount of the actual bill so
- 18:11all we had was the tip amount we only
- 18:13had the one variable we only had the
- 18:16dependent variable at that so the best
- 18:19way we could do is make a graph based on
- 18:21the mean of the tip data which was $10
- 18:25so then we went through and found the
- 18:26residuals and squared those and then
- 18:28added them up so with the sum of squared
- 18:30errors or squared residuals of
- 18:33120 so in this case what's the slope of
- 18:37this line well it's zero because the
- 18:40independent variable doesn't even exist
- 18:43so the slope of this line is zero
- 18:46because we're only using the values of
- 18:48the dependent
- 18:49variable so when conducting simple
- 18:52linear regression with two variables we
- 18:54will determine how good the regression
- 18:56line fits the data by comparing ing it
- 18:59to this type where we pretend the second
- 19:02variable does not even exist so we
- 19:05covered that in the previous video but
- 19:07the important thing to apply in this
- 19:09video is that the slope of this example
- 19:13the slope of the special type of
- 19:16situation is zero so this is when beta
- 19:19sub one is zero so any regression line
- 19:23we come up with we will always be
- 19:26comparing it to the situation a where
- 19:29the slope is zero and the most extreme
- 19:33case where the slope is zero is where
- 19:35the dependent variable is where the
- 19:37independent variable does not even exist
- 19:42so in this situation the value of y hat
- 19:46is 10 for every value of x so we can
- 19:51actually do this algebraically so y Hat
- 19:53= B Sub 0 + B sub 1 * X but the slope 0
- 19:59so we insert that in where B sub1 is so
- 20:02we're left with Y hat equals B Sub 0 but
- 20:07what is B Sub 0 well it's 10 so y hat
- 20:12equals 10 for every point along the x
- 20:15axis so for the second tip it's $10 for
- 20:19the fifth tip it's $10 for the fourth
- 20:21tip it was $10 so we're always comparing
- 20:23our regression model to this example
- 20:26where beta sub one is Z or the slope is
- 20:33zero so let's go ahead and do a quick
- 20:35exercise where we can match an equation
- 20:37with the general regression model so we
- 20:39have an equation that's y hat equal 0.3
- 20:43minus 3.3x then we have y hat = 48 +
- 20:487.8x and then y hat = 14.87%
- 20:58our slope beta sub one is at or near
- 21:01zero in the second example our slope is
- 21:04positive so beta sub 1 is positive and
- 21:07our last one beta sub one is negative so
- 21:11let's go back up to our first equation
- 21:13what is the value of the slope in our
- 21:16first equation well it's
- 21:183.3 so it's negative so which one does
- 21:21that go
- 21:22with that General shape so if we graph
- 21:26this equation it probably look something
- 21:27like the bottom right right now what
- 21:29about our second equation what is the
- 21:32slope there well it's positive
- 21:357.8x so it would look maybe like the
- 21:38second example here at the bottom now
- 21:40what about our third one our slope is
- 21:44.014 well that's very very close to zero
- 21:47it's not exactly zero but it's close so
- 21:50if we graph that line it would probably
- 21:52look something like that so again
- 21:55depending on the value or the sign of
- 21:58the slope we can have a general idea
- 22:01what the regression line will look
- 22:05like let's go ahead and get ready for
- 22:08conducting the least squares which we
- 22:09will do in the next video now remember
- 22:12in the first video in regression we only
- 22:15had the dollar amount of the tip that
- 22:17the waiters or waitresses received we
- 22:19didn't have the meal amount so now we're
- 22:22going to go ahead and add that
- 22:24in so for the Bill of $34 I had a tip of
- 22:27$5 for a bill of $18 I had a tip of $17
- 22:32and so on and so forth now when we go
- 22:34ahead and graph those on a scatter plot
- 22:37it looks like this over here on the left
- 22:40so you can see where each data point
- 22:41Falls with relationship to the bill
- 22:43amount and the tip amount now remember
- 22:46what we're saying here is that the tip
- 22:49dollar amount depends on the original
- 22:54bill amount that's what we think that's
- 22:56what we're sort of hypothesizing so in
- 22:59general a lower bill will result in a
- 23:02lower tip and a more expensive bill will
- 23:05result in a higher tip that's sort of
- 23:08our hypothesis so if we graph these on
- 23:11the scatter plot we can look and it
- 23:13appears that there's some sort of linear
- 23:15relationship that goes from left to
- 23:18right so if we drew a line it would
- 23:21probably start the lower left and go to
- 23:23the upper right and most importantly
- 23:28if that
- 23:29line reduces the residual sum of squares
- 23:34significantly from the model where we
- 23:36only use the mean of the tips of
- 23:38$10 then that's when we will say that a
- 23:41regression model is good sort of an equ
- 23:44qualitative sense now quantitatively
- 23:46we'll be able to figure that out more
- 23:48concretely but generally if the residual
- 23:51sum of squares is a lot less using our
- 23:54regression line we come up with using
- 23:56the least squares method then we know
- 23:59that our regression line is much better
- 24:01than the example where we only use the
- 24:03mean tip
- 24:06amount okay so that wraps up our second
- 24:08video in our linear regression series
- 24:11and again here I wanted to review a
- 24:12couple things sort of the algebra of
- 24:14regression lines some general model
- 24:17equations that you will see going
- 24:18forward and you will see in your own
- 24:20work and then some general graph
- 24:22patterns that you can look at look at
- 24:23the equation and try to figure out what
- 24:25the graph means and vice versa so again
- 24:28this just sort of lays the groundwork
- 24:29for the actual calculations that will'll
- 24:31start in the next video where we will
- 24:33actually calculate the least squares
- 24:35method and figure out our regression
- 24:37line by hand
- 24:42[Music]
About this transcript
This page contains the full transcript of YouTube transcript (iAgYLRy7e20) , generated from the public captions YouTube serves with the video. The transcript has 3,895 words across 517 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.