YouTube2Text

YouTube transcript (YwsYKNWSw2o) — Transcript

3,136 words · 424 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hello and welcome to the next video in
  2. 0:02my series on basic statistics if you are
  3. 0:05a firsttime viewer please stick around
  4. 0:07for the intro it is worth the time at
  5. 0:09least once if you are a regular viewer
  6. 0:11feel free to skip ahead using The
  7. 0:13annotation so first a few things I do
  8. 0:16these videos because I love to learn and
  9. 0:18help others learn we are all good at
  10. 0:20something so I encourage you to give
  11. 0:23back to the world in a similar way share
  12. 0:25your passion whatever it is any way you
  13. 0:28can now this video focuses on basic
  14. 0:31stats and is not a quick fix it aims to
  15. 0:34be thorough my goal is an understanding
  16. 0:37of fundamental concepts and that takes
  17. 0:39time but when you understand the
  18. 0:40fundamentals learning other topics is
  19. 0:43much easier now related to that if
  20. 0:46you're watching because you are
  21. 0:47struggling in a class or at work I want
  22. 0:50you to stay positive and keep your head
  23. 0:51up you can learn this I have faith in
  24. 0:55you many other people around you have
  25. 0:57faith in you and so should you
  26. 1:00feel free to connect with me on LinkedIn
  27. 1:03go+ Twitter and of course subscribe here
  28. 1:06on YouTube now if you think there is
  29. 1:08something I can do better please leave a
  30. 1:10constructive comment below I do take
  31. 1:13those comments into account when I make
  32. 1:14new videos I also encourage you to talk
  33. 1:17with other viewers in the comments help
  34. 1:19each other when you can and finally if
  35. 1:22you like the video please give it a
  36. 1:24thumbs up share it with classmates or
  37. 1:27colleagues and put it on a playlist for
  38. 1:29review later that does encourage me to
  39. 1:31keep making them for you so let's go
  40. 1:34ahead and start
  41. 1:37learning so this video is the next in
  42. 1:40our series about multiple regression now
  43. 1:42it's really an extension of part four
  44. 1:44and in part four we looked at the case
  45. 1:46where we had one dummy variable in this
  46. 1:49video we're going to extend that to two
  47. 1:51dummy variables we will see how to set
  48. 1:53up the problem we will see how to
  49. 1:54conduct the analysis and then interpret
  50. 1:56our result in the end now if you did not
  51. 1:59watch part 4
  52. 2:00I highly recommend going back and
  53. 2:01watching it before proceeding with this
  54. 2:04one so that small warning aside let's go
  55. 2:07ahead and get
  56. 2:10started so as in the last video you are
  57. 2:13an analyst for a small company that
  58. 2:15develops house pricing models for
  59. 2:17independent Realtors to generate your
  60. 2:19models you use publicly available data
  61. 2:22such as the list price the square
  62. 2:23footage the number of bedrooms number of
  63. 2:25bathrooms among other data points that
  64. 2:27you
  65. 2:28collect now now in this problem you're
  66. 2:30interested in two main questions number
  67. 2:33one is the public high school in the
  68. 2:36neighborhood exemplary which is the
  69. 2:38highest rating and how is that rating
  70. 2:41related to the home price if at all
  71. 2:44number two what region so north south
  72. 2:47east or west of the city is the home
  73. 2:50located and how is that related to the
  74. 2:52home price if at all now you'll notice
  75. 2:55that this data is not quantitative it is
  76. 2:58qualitative they are categ atories in
  77. 3:01the first case the high school is either
  78. 3:02exemplary or it's not it's a yes or no
  79. 3:05question in the second case it's just
  80. 3:07the region or the directions of north
  81. 3:09south east or west so because we have
  82. 3:12categorical data we will need to use
  83. 3:14dummy variables in our regression to
  84. 3:16conduct this
  85. 3:19analysis so in this problem we are going
  86. 3:22to use 100 fictitious observations I did
  87. 3:26make up this data for this video so here
  88. 3:29are the first 15 observations let's go
  89. 3:31ahead and look at our data structure in
  90. 3:33the First Column we have our dependent
  91. 3:35variable which is price so the first
  92. 3:37home is
  93. 3:41$450,000 now in the second column we
  94. 3:43have our first independent variable
  95. 3:45that's the square footage so that first
  96. 3:47home is
  97. 3:493,860 square ft it's a very big home in
  98. 3:53the third column we have our second
  99. 3:55independent variable and that is whether
  100. 3:57or not the high school is exemplary or
  101. 3:59not so it's either yes or no and then in
  102. 4:03the fourth column we have our third
  103. 4:05independent variable which is region so
  104. 4:08north south east or west and that's how
  105. 4:11our data was originally collected now
  106. 4:13the first thing we're going to do is
  107. 4:15some recoding we're going to change our
  108. 4:17text entries such as yes no north south
  109. 4:20east or west into numerical values and
  110. 4:22we can do that like this so for examplar
  111. 4:26high school if it's a yes we code that
  112. 4:28as one if it's it's a no we code that as
  113. 4:30zero now for location we do it a bit
  114. 4:33differently I'm going to code these in
  115. 4:35alphabetical order and I do that to make
  116. 4:37many tab happy which I'll talk about
  117. 4:39later so East is the first alphabetical
  118. 4:42region so we'll give that a code of zero
  119. 4:45and then we have North which is a code
  120. 4:46of one then we have South which is a
  121. 4:49code of two and finally we have West
  122. 4:52which is a code of three so up to this
  123. 4:54point we've gone from text entries to
  124. 4:57numerical entries but we have not
  125. 4:59created our dummy variables yet we're
  126. 5:01going to go ahead and do that
  127. 5:02now so here we have what I call
  128. 5:05dumbification so the price column is the
  129. 5:08same the square footage column is the
  130. 5:10same the exemplary High School column is
  131. 5:12the same but now we have three dummy
  132. 5:15variables South West and North now you
  133. 5:19might be saying to yourself wait a
  134. 5:20minute we have four locations north
  135. 5:23south east and west but we only have
  136. 5:25three dummy variables well if you
  137. 5:27remember from part four our number of
  138. 5:29dummy variables is always the number of
  139. 5:31categories minus one so we have four
  140. 5:34categories north south east west minus
  141. 5:37one is three so we have three dummy
  142. 5:41variables now I think it's pretty
  143. 5:42straightforward to see how these are
  144. 5:44coded so for the first home we have it
  145. 5:47as being in the South Region so over
  146. 5:50here on the right for South we put a one
  147. 5:52under the South column now for the
  148. 5:54second home it's in the North Region so
  149. 5:57in that case we put a one in the the
  150. 5:59north column and the other regions are
  151. 6:01zero so you can kind of see how this
  152. 6:03works but you'll notice that there's no
  153. 6:06column for
  154. 6:08East Now by far the most important thing
  155. 6:11the most valuable thing you can do
  156. 6:12before you ever run a test before you
  157. 6:14ever crunch the numbers or anything is
  158. 6:17to look at some Scatter Plots of your
  159. 6:19data so here we have the price of the
  160. 6:22home versus its square footage along the
  161. 6:24x axis at the bottom we have the square
  162. 6:26footage and on the Y AIS on the left we
  163. 6:29have the price now we can see that this
  164. 6:31is a pretty linear relationship if we
  165. 6:34just sort of eyeballed a best fit line
  166. 6:36we would see that it runs sort of
  167. 6:37through the middle of the data now I
  168. 6:39would argue that this is probably a
  169. 6:40curval linear relationship but in this
  170. 6:43case we are doing linear regression
  171. 6:45we'll talk about nonlinear regression at
  172. 6:47a later point but we can see that this
  173. 6:49is a definite pattern of a smaller home
  174. 6:52having a smaller price and larger homes
  175. 6:54having larger
  176. 6:58prices now this Scutter plot is a bit
  177. 7:00more interesting as it separates out our
  178. 7:02data into groups so as you can see the
  179. 7:05blue dots represent homes where the high
  180. 7:08school is not exemplary and the red
  181. 7:11squares represent homes where the high
  182. 7:14school is exemplary now you can see a
  183. 7:17definite pattern here look at the blue
  184. 7:19dots where are they well they're
  185. 7:22definitely along the bottom of this
  186. 7:24scatter plot so especially if you look
  187. 7:27from about 2,000t homes up to 3,000 ft
  188. 7:31homes the blue dots are consistently
  189. 7:34below the red squares now we can go
  190. 7:36ahead and put some lines just sort to
  191. 7:38eyeball it and there they are so let's
  192. 7:40step back and look at the big picture
  193. 7:43let's take a average home that is
  194. 7:462500 ft now we can see that for a home
  195. 7:50that's 2500 ft the price of a home where
  196. 7:52the high school is not exemplary the
  197. 7:55blue dots in line is about $150,000
  198. 7:58[Music]
  199. 8:00now for the same size home 2500 sare ft
  200. 8:04if the high school is exemplary the home
  201. 8:08is a little bit over
  202. 8:11$200,000 so for the same size home the
  203. 8:15only difference being whether the high
  204. 8:16school is exemplary or not we have a
  205. 8:19price difference of over
  206. 8:23$50,000 so we can think of that as the
  207. 8:25exemplary High School premium price
  208. 8:29given the same size home the one where
  209. 8:32the high school is exemplary Demands a
  210. 8:35price that is about $50,000 more and I
  211. 8:38find things like that very interesting
  212. 8:40so let's go ahead and keep that in the
  213. 8:41back of our minds as we go
  214. 8:46forward so here we have a very busy
  215. 8:48graph here we're looking at the regions
  216. 8:51on the same basic scatter plot so we
  217. 8:53have East which are blue dots North
  218. 8:56which are red squares South which are
  219. 8:58green diamonds and West which is purple
  220. 9:01triangles so what general patterns do we
  221. 9:03see here what looks like the West holes
  222. 9:06the purple triangles stay along the
  223. 9:08bottom of the scatter plot the north
  224. 9:10homes kind of stay along the top of the
  225. 9:12scatter plot and then you know the other
  226. 9:15ones the East and the South kind of stay
  227. 9:19in the middle of the scatter plot so
  228. 9:21let's help ourselves out by putting some
  229. 9:23best fit lines on this
  230. 9:27graph now that's a bit easier to read so
  231. 9:30we can learn a ton of information just
  232. 9:32from this scatter plot so let's look at
  233. 9:34the West homes first so those are the
  234. 9:37purple triangles as we can see they're
  235. 9:39along the bottom of the scatter plot
  236. 9:42they start at around,
  237. 9:441500t the largest one is about 3500 ft
  238. 9:48now the price does not increase as
  239. 9:52steeply as the other regions you can see
  240. 9:55that the slope of the purple line of the
  241. 9:57dash line is quite a bit shallower than
  242. 10:01the slope of the other three lines so in
  243. 10:04the west region as the homes get larger
  244. 10:08the price doesn't go up as much as the
  245. 10:11other regions now let's look at the
  246. 10:13green the South Region so we have the
  247. 10:16green diamonds now there the smallest
  248. 10:18home is about 2,000 sare ft and they go
  249. 10:21all the way up to almost 4,000 sare ft
  250. 10:24now look at the slope of that line it is
  251. 10:28Extreme L steep so as the homes get
  252. 10:32bigger the price shoots up very rapidly
  253. 10:35as compared to the other regions so we
  254. 10:37can sort of see the difference here in
  255. 10:40the west we have smaller homes that are
  256. 10:43less expensive the price increases less
  257. 10:46as the home gets bigger in the opposite
  258. 10:48extreme we have the south region where
  259. 10:51the homes start a bit bigger and as they
  260. 10:53get bigger the price goes up
  261. 10:55dramatically and then we have the other
  262. 10:57two the East and the North which kind of
  263. 11:00hang around in the middle so we can
  264. 11:02definitely see the relationship between
  265. 11:04square footage the size of the home and
  266. 11:06the price as separated out by region so
  267. 11:10keep that in mind as we go
  268. 11:14forward so here we're going to look at a
  269. 11:16surface plot now the purist out there
  270. 11:19I'm going to note because I know you're
  271. 11:21going to say something probably that
  272. 11:22this is not the best use of a surface
  273. 11:25plot and I know that I'm just using this
  274. 11:28as a visual tool to show the difference
  275. 11:31in price in square footage across
  276. 11:34another variable so here we have a
  277. 11:36surface plot of price which a square
  278. 11:37foot in three dimensions and exemplary
  279. 11:40high school you can see that we have the
  280. 11:42price and the vertical axis we have the
  281. 11:44square footage in the z-axis front to
  282. 11:47back then we have the exemplary High
  283. 11:49School category running along the x-axis
  284. 11:52here in the front here's the question is
  285. 11:56the surface tilted downward where where
  286. 11:59the exemplary High School equals zero so
  287. 12:01down here in the lower left corner is
  288. 12:03this sort of tilted down into the
  289. 12:06left so if we're looking at this from
  290. 12:08the front view if we were standing right
  291. 12:11where it says exempt High School exempt
  292. 12:14HS down here at the bottom if we stood
  293. 12:16there and looked at it would it look
  294. 12:18like this would it start at the bottom
  295. 12:20and then kind of slope up up towards
  296. 12:22where we have one well I would say yes
  297. 12:27so what does that tell us that tells us
  298. 12:29that as we go from 0 to one from a not
  299. 12:33exemplary High School to an exemplary
  300. 12:36High School the price and the square
  301. 12:39footage both tend to increase so this
  302. 12:42threedimensional plane is sort of tilted
  303. 12:45down here at
  304. 12:460.0 and kind of goes up as we go to the
  305. 12:49right and somewhat to the back and
  306. 12:52that's how we can use this 3D plot to
  307. 12:54visualize our data and again it's not
  308. 12:56the proper use of a 3D plot but it does
  309. 12:58help us visualize this in three
  310. 13:02dimensions so here's a surface plot of
  311. 13:04price and square foot again but this
  312. 13:06time location is here in the front axis
  313. 13:10so what are we looking for here now are
  314. 13:13there front to back what I would call
  315. 13:15sort of mountain ranges at any location
  316. 13:18so do they run front to back like this
  317. 13:22does any location have higher prices
  318. 13:26across the surface taking into account
  319. 13:28the square footage well what do you
  320. 13:30think about that well I think they all
  321. 13:34tend to follow the same basic pattern or
  322. 13:36most of them do we can definitely tell
  323. 13:38that the east region front to back has
  324. 13:41that one Spike at around 3,000 square ft
  325. 13:44the South kind of goes up as it proceeds
  326. 13:47to the back the west region however
  327. 13:50really increases in price and square
  328. 13:53footage as it goes to towards the back
  329. 13:55and the north maybe a little bit less so
  330. 13:58so here we can see that the west region
  331. 13:59it seems like has the biggest change in
  332. 14:03square footage and price as we increase
  333. 14:06both of those
  334. 14:10Dimensions okay so this is probably the
  335. 14:12most complicated slide in this uh
  336. 14:14presentation so I want to do it real
  337. 14:15slow so you understand where everything
  338. 14:16is coming
  339. 14:17from so here is our estimated regression
  340. 14:20equation so we have the expected value
  341. 14:22of y which is our dependent variable
  342. 14:25equals beta Sub 0 which is our intercept
  343. 14:28and then we have our series of
  344. 14:30independent variables from beta 1 X1 all
  345. 14:33the way up to Beta 5 X5 now remember
  346. 14:36these all stand for something so we have
  347. 14:38our constant which is our intercept and
  348. 14:40then beta 1 X1 is our coefficient and
  349. 14:43then X1 is our square footage variable
  350. 14:46then X2 is our exemplary High School
  351. 14:48variable and then Southwest and North
  352. 14:51are our dummy variables we can think of
  353. 14:53those kind of as a group so here are all
  354. 14:56of our variables as represented in our
  355. 14:58estimated regression
  356. 14:59equation now let's look at an example
  357. 15:02what's the expected value of the home
  358. 15:04price given that the high school is not
  359. 15:08exemplary so in that case X2 is zero if
  360. 15:14you look up here for exemplary high
  361. 15:16school at the top that's our X2 variable
  362. 15:19so if it's not exemplary we know that
  363. 15:21that value is a zero and the home is in
  364. 15:25the west so remember for X4 that's our
  365. 15:29West dummy variable so that would be a
  366. 15:31one in that spot so we can write this
  367. 15:33out using some notation so the expected
  368. 15:36value of y our dependent variable given
  369. 15:38that's sort of the vertical line pipe
  370. 15:40there that is not exemplary and it's in
  371. 15:43the west equals beta 0 plus beta 1 X1
  372. 15:47plus remember that's our square footage
  373. 15:49plus beta 2 X2 but in this case X2 is
  374. 15:54zero because the high school is not
  375. 15:57exemplary then we have beta 3 0 well why
  376. 16:01is that that's because the home is not
  377. 16:03in the south then we have beta 4 * 1
  378. 16:07well why is that a one that's because
  379. 16:09our home is in the west if we look up
  380. 16:11there we have beta 4 X4 where the West
  381. 16:14is so that's a one then we have beta 5 0
  382. 16:18that's a zero well why because the home
  383. 16:20is not in the North so what we can do is
  384. 16:23actually do some simple algebra here and
  385. 16:25reduce this down to this so we have beta
  386. 16:290 + beta 1 X1 + beta 4 now where does
  387. 16:33that come from well if you look at the
  388. 16:35one above it anything that's multiplied
  389. 16:37by zero goes away so beta 2 goes away
  390. 16:40beta 3 goes away and beta 5 goes away
  391. 16:43because they're all multiplied by 0 so
  392. 16:46we're left with beta 0 + beta 1 X1 +
  393. 16:50beta 4 because beta 4 * 1 is beta 4
  394. 16:53itself so that is our simplified
  395. 16:56estimated regression equation for this
  396. 16:58particular
  397. 16:59example so what are the total number of
  398. 17:02possible equations we could actually
  399. 17:04have in this problem well we're always
  400. 17:08going to have one constant which is our
  401. 17:11beta 0 times our 1 s foot variable
  402. 17:15that's just a simple quantitative
  403. 17:17variable times two for our exemplary
  404. 17:19High School variable it can take the
  405. 17:22value of a one or zero so in that spot
  406. 17:26we have two possibilities it's either
  407. 17:28one or zero now for the region we have
  408. 17:32four possibilities so in this case we
  409. 17:36could have 1 0 0 which is South we could
  410. 17:39have 0 1 0 which is West we could have
  411. 17:41001 which is north or we could have 0000
  412. 17:450 which is a home in the east region so
  413. 17:50we multiply all these possibilities for
  414. 17:52each part of our estimated regression
  415. 17:54equation we have eight possible
  416. 17:58equations
  417. 17:59in this multiple progression model with
  418. 18:01these two dummy variables so 1 * 1 is 1
  419. 18:04* 2 for two possibilities for examplar
  420. 18:07high school times four possibilities for
  421. 18:10the region which we can see over here on
  422. 18:12the right 1 * 1 * 2 * 4 is 8 and we'll
  423. 18:16actually see all eight of these
  424. 18:18equations here in a minute or two

About this transcript

This page contains the full transcript of YouTube transcript (YwsYKNWSw2o) , generated from the public captions YouTube serves with the video. The transcript has 3,136 words across 424 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.