YouTube2Text

Linear regression for economists: The linear model. — Transcript

by MetricsProf · 2,538 words · 437 segments · language en · Watch on YouTube

Full transcript

  1. 0:01welcome back in this video we'll talk
  2. 0:04about the linear regression
  3. 0:07mod previously we have developed a model
  4. 0:09for test score
  5. 0:15production the test score is a classroom
  6. 0:17outcome variable that we interested in
  7. 0:20the test score Y is equal to the
  8. 0:23potential
  9. 0:24outcome why evaluated at the treatment D
  10. 0:29that this classroom receives and our
  11. 0:31treatment was classroom size and the
  12. 0:34value of a confounder x and we consider
  13. 0:38the PD index as an example for a
  14. 0:40confounder where the PD index measures
  15. 0:42the percentage of disadvantaged students
  16. 0:45at the school we have imposed some
  17. 0:48structure on this potential outcome
  18. 0:50function namely we have assumed that we
  19. 0:53can write it as M where m is an unknown
  20. 0:57function but that is the same for all
  21. 0:59class rooms evaluated add treatment and
  22. 1:06confounder plus an error term
  23. 1:10U every classroom can have their own
  24. 1:13value of test score classroom size
  25. 1:17confounder and err term
  26. 1:20U the M function is shared between
  27. 1:24classrooms what do we assume about
  28. 1:26observability we assume that y D and X
  29. 1:31can be
  30. 1:33observed the error term is
  31. 1:40unobserved the function m is
  32. 1:45unknown we assume that U is balanced in
  33. 1:49the following sense if we
  34. 1:53average u in any subpopulation
  35. 1:56characterized by a classroom size equal
  36. 2:00to lowercase D and a PD index equal to
  37. 2:05lowercase
  38. 2:07x that average will be equal to
  39. 2:11zero when this balancing assumption is
  40. 2:13satisfied then we say that the error
  41. 2:16term is
  42. 2:23exogenous under this assumption the M
  43. 2:26function has a very particular
  44. 2:28interpretation to see this let's take
  45. 2:31the average of Y over this
  46. 2:40subpopulation this will be equal
  47. 2:46to and now I would just plug in for
  48. 2:52y instead of Y I will put the right hand
  49. 2:56side and these are equal by these dise
  50. 3:05equalities now note that in this
  51. 3:07subpopulation every class has this class
  52. 3:10size and this PD
  53. 3:13index so I can replace the general class
  54. 3:16size NPD index by these two specific
  55. 3:22values this is just the M function
  56. 3:25evaluated at values lowercase D and
  57. 3:28lowercase x this will just be a number
  58. 3:31and since it's a fixed number it's just
  59. 3:34shifting the average by this amount this
  60. 3:38means I can take this out of the
  61. 3:46average now this here will be equal to
  62. 3:51zero by The Balancing
  63. 3:54assumption and therefore we just be left
  64. 3:58with this
  65. 4:02we've now shown that M gives us the
  66. 4:05population average or the mean of Y for
  67. 4:09given DN
  68. 4:11x a good name for m is therefore to call
  69. 4:15it the conditional mean
  70. 4:20function we can abbreviate this by
  71. 4:23writing
  72. 4:26cmf for reasons that will become
  73. 4:28appearance soon we sometimes also call m
  74. 4:31the regression
  75. 4:34curve what we've learned here may help
  76. 4:37us interpret our identification result
  77. 4:39for the treatment effect here we've
  78. 4:41written the treatment effect as the
  79. 4:43difference of two M
  80. 4:45functions now we know that this is the
  81. 4:48difference between the means of two
  82. 4:51subpopulations therefore it's not
  83. 4:52surprising that we estimated the
  84. 4:54treatment effect by subtracting averages
  85. 4:56over two
  86. 4:58subsamples but there was an issue with
  87. 5:00this strategy do you
  88. 5:03remember yes that's right the subsamples
  89. 5:05that we picked were really small they
  90. 5:07consisted only of three and four
  91. 5:10observations that's way too small to be
  92. 5:13informative about the
  93. 5:14population ideally we want to use our
  94. 5:17whole sample and not just these small
  95. 5:19subsamples to learn about treatment
  96. 5:22effects we can do this by making a
  97. 5:24parametric assumption and that's what we
  98. 5:26do next this additional assumption will
  99. 5:29yield the linear regression
  100. 5:36model so far we have assumed that Y is
  101. 5:41equal to M evaluated at treatment D and
  102. 5:47confounder
  103. 5:48X plus an error term before introducing
  104. 5:52the linear regression model I want to
  105. 5:54get back to something that I talked
  106. 5:56about
  107. 5:57earlier I said that sometimes you want
  108. 5:59to control for an additional confounder
  109. 6:01other than x then we can do that by
  110. 6:04changing the definition of the M
  111. 6:05function slightly let's do this right
  112. 6:08now we just add the additional
  113. 6:10confounder to our M
  114. 6:14function there we
  115. 6:17go now the labeling of the confounders
  116. 6:21is a little asymmetric I'd rather label
  117. 6:23them X1 and
  118. 6:25X2 for reasons that will become apparent
  119. 6:28later it's even SM to label them X2 X3
  120. 6:33so we're skipping the subscript one for
  121. 6:35now and start labeling with a
  122. 6:38two all these orange colored variables
  123. 6:41are observable what do they correspond
  124. 6:44to in our
  125. 6:46example our outcome Y is given by the
  126. 6:49test
  127. 6:50score treatment D is given by the class
  128. 6:54size the PD index is our first
  129. 6:58confounder as let's call it
  130. 7:00X2 and cord size can be another
  131. 7:03confounder let's call it
  132. 7:06X3 at this point we have to be a little
  133. 7:08bit more precise we're not sure that the
  134. 7:12PD index is indeed a
  135. 7:14confounder at this point we should
  136. 7:16consider it a potential
  137. 7:22confounder we adding it to our model to
  138. 7:24control for it therefore we also call it
  139. 7:27a control variable
  140. 7:30or sometimes we just call it a
  141. 7:33control now we can finally discuss the
  142. 7:36linear regression model for the linear
  143. 7:38regression model we make one additional
  144. 7:41assumption we assume that we have
  145. 7:43partial knowledge about
  146. 7:45M while we don't pin down M completely
  147. 7:48we assume that we roughly know its shape
  148. 7:52such an assumption is called a
  149. 7:53functional form assumption or a
  150. 7:55parametric
  151. 7:58assumption
  152. 8:00in particular we assume that we can
  153. 8:02write M as follows M at arbitrary
  154. 8:06lowercase
  155. 8:07D
  156. 8:09X2 and X3 can be specified as
  157. 8:23follows here the blue Greek letters
  158. 8:27Alpha Gamma and beta
  159. 8:30are called
  160. 8:33coefficients and they stand for fixed
  161. 8:35but unknown
  162. 8:37numbers if we knew these values then we
  163. 8:40would know exactly what M looks like the
  164. 8:44first number here that doesn't multiply
  165. 8:45anything and that just shifts the
  166. 8:47regression curve is called The
  167. 8:52Intercept a number that multiplies a
  168. 8:56variable is called a slope coefficient
  169. 9:05in the context of linear regression
  170. 9:07model the observable variables on the
  171. 9:09right hand side that is dx2 and X3 are
  172. 9:13called the
  173. 9:14regressors slope coefficients multiply
  174. 9:17regressors to give an
  175. 9:20example maybe our M function looks like
  176. 9:28this
  177. 9:35here I've have retained the plus
  178. 9:38signs so that the pattern is
  179. 9:41apparent in practice obviously once we
  180. 9:44have negative coefficients we often
  181. 9:46don't explicitly write out the plus sign
  182. 9:51the negative sign here means that
  183. 9:53subpopulations with larger classes have
  184. 9:56on average lower test scores keeping
  185. 9:59everything else equal similarly
  186. 10:02subpopulations with a larger PD score
  187. 10:05that is a higher percentage of
  188. 10:06disadvantage students have on
  189. 10:09average a lower test score keeping all
  190. 10:12other variables
  191. 10:15equal of course if we knew the numerical
  192. 10:18values of the
  193. 10:19coefficients we would know exactly what
  194. 10:21the M function is and then it would be
  195. 10:24easy to figure out treatment
  196. 10:26effects we could figure out the
  197. 10:28treatment effects by plugging into this
  198. 10:30formula which is no big deal if we know
  199. 10:32what m
  200. 10:33is in practice the numerical value of
  201. 10:36these coefficients are unknown and we
  202. 10:38have to use data to figure them out it's
  203. 10:42very easy to compute the setus parabus
  204. 10:44causal effect for the linear
  205. 10:48model adapting our earlier formula the
  206. 10:52setus parabus treatment
  207. 10:56effect is given by the M function
  208. 10:59evaluated at Baseline treatment + one
  209. 11:04and confounders at Baseline
  210. 11:09level minus M function at Baseline
  211. 11:13treatment and Baseline confounder
  212. 11:19levels now let's plug in the linear
  213. 11:22parametric form that we assumed for
  214. 11:27m
  215. 11:31so this here is just the first part now
  216. 11:36for the second
  217. 11:44part let's
  218. 11:46subtract it's easy to see that the alpha
  219. 11:50cancels that the gamma time D
  220. 11:54cancels this will also cancel this will
  221. 11:57also cancel the only thing that we'll be
  222. 11:59left with is gamma *
  223. 12:041 gamma is obviously the slope
  224. 12:08coefficient of
  225. 12:12treatment and this shows us that slope
  226. 12:15coefficients immediately translate to
  227. 12:17treatment
  228. 12:19effects gamma is also called the
  229. 12:21marginal
  230. 12:24effect because it gives the additional
  231. 12:27effect of one more unit
  232. 12:32the notion of a marginal change is
  233. 12:34obviously related to differential
  234. 12:36calculus and indeed if we take the M
  235. 12:43function and we partially differentiate
  236. 12:46it with respect to
  237. 12:48D we will get exactly
  238. 12:52gamma our functional form assumption
  239. 12:56restricts the treatment effect in two
  240. 12:58important important ways our treatment
  241. 13:02effect is
  242. 13:06independent of the level of X2 and
  243. 13:15X3 and it's also independent of the
  244. 13:18Baseline treatment
  245. 13:22intensity we discuss this more in the
  246. 13:24future and we also discuss how we can
  247. 13:26relax these restrictions Within a linear
  248. 13:29regression
  249. 13:30model while the linear regression model
  250. 13:33is restrictive in some sense at this
  251. 13:35point it's not really clear what it
  252. 13:37biases remember we adapted the
  253. 13:39parametric assumption to help us use all
  254. 13:42of the sample instead of just a small
  255. 13:46subset of it how does the linear
  256. 13:49aggression model help with our
  257. 13:51identification
  258. 13:55problem consider the conditional mean
  259. 13:57function M as add Baseline confounder
  260. 14:02values but arbitrary treatment intensity
  261. 14:05lower case D we can depict how M changes
  262. 14:09as D varies in a two-way
  263. 14:14plot we put D on the
  264. 14:17x-axis and the conditional mean function
  265. 14:20on the y-
  266. 14:21AIS for every step that we take in D
  267. 14:26direction that is for every addition
  268. 14:28unit of treatment intensity or for every
  269. 14:31additional student in our class we
  270. 14:34change the conditional mean function by
  271. 14:38gamma let's use this example where gamma
  272. 14:41is
  273. 14:42negative this means that the condition
  274. 14:44mean function is downward
  275. 14:47sloping now consider our Baseline
  276. 14:50treatment of a class size of
  277. 14:5635 we can read of the value of the M
  278. 14:59function at 35 from this graph it's
  279. 15:01right
  280. 15:02here if we increase classroom size by
  281. 15:08one we decrease the M function by
  282. 15:12gamma gamma is the treatment effect that
  283. 15:14we want to
  284. 15:15learn from this picture it's clear that
  285. 15:18we can learn gamma by comparing
  286. 15:20classrooms of size 35 to classrooms of
  287. 15:24size
  288. 15:2636 this is what we did previously and
  289. 15:28previously this was also the only thing
  290. 15:30that we could
  291. 15:31do but now consider a classroom size of
  292. 15:34let's say
  293. 15:3625 increase classroom size by
  294. 15:40one this will decrease the M function by
  295. 15:43that's right
  296. 15:46gamma this means we can also learn gamma
  297. 15:50by comparing classrooms of size 25 and
  298. 15:5426 if you think carefully about it you
  299. 15:57realize that there are many other
  300. 15:58comparisons that we can make and that
  301. 16:00will allow us to learn
  302. 16:02gamma in fact all variation in treatment
  303. 16:05intensity is now useful for learning
  304. 16:09gamma all of this was of course with the
  305. 16:13axes fixed at the Baseline values we're
  306. 16:16still not using the whole
  307. 16:18sample the next step is realizing that
  308. 16:21if we fix these axes at any other values
  309. 16:24then we will draw a picture that looks
  310. 16:26very similar at least we will draw a
  311. 16:28curve with the same slope it may be
  312. 16:31shifted upwards or downwards but it will
  313. 16:35have the same
  314. 16:36slope and therefore we can use the same
  315. 16:39argument to again learn gamma even if we
  316. 16:43have different
  317. 16:44AES this will allow us to use the whole
  318. 16:47sample to learn
  319. 16:53gamma you may be wondering how do we do
  320. 16:56this exactly but that's a topic we look
  321. 16:58into into
  322. 17:01later so far we've looked at the linear
  323. 17:03regression model in the context of this
  324. 17:07specific treatment effect
  325. 17:09model but beyond that the linear
  326. 17:11regression model plays a very important
  327. 17:12role in econometrics and
  328. 17:15statistics for example the linear
  329. 17:17regression model is not only used for
  330. 17:19causal inference but also for making
  331. 17:21predictions and for forecasting economic
  332. 17:24variables let's briefly look at the
  333. 17:27general generic linear regression
  334. 17:34model in our example we were looking at
  335. 17:37M of dx2 and
  336. 17:42X3 and M was equal to the conditional
  337. 17:45expectation of Y where we average over a
  338. 17:49subpopulation and to determine the
  339. 17:51subpopulation we're looking at
  340. 17:53everyone's D X2 and X3 so in our example
  341. 18:00this was classroom size PD index and
  342. 18:03cohort
  343. 18:05size and you belong to the subpopulation
  344. 18:08that we are averaging over if your D is
  345. 18:11equal to this value and your X2 is equal
  346. 18:15to this
  347. 18:16value and so
  348. 18:19forth in our treatment application this
  349. 18:22link between the M function and the
  350. 18:25conditional expectation arose from the
  351. 18:27balance
  352. 18:28assumption here's the
  353. 18:31derivation in other regression contexts
  354. 18:34we may just Define the mm function to be
  355. 18:37equal to this conditional
  356. 18:40expectation under our parametric
  357. 18:42assumption this conditional expectation
  358. 18:45is
  359. 18:52linear in our treatment application it
  360. 18:55was very natural to split up our
  361. 18:56regressors into two groups groups a
  362. 18:59treatment
  363. 19:01variable and control variables in other
  364. 19:04regression contexts such a split is not
  365. 19:07natural and it makes more sense to just
  366. 19:08have one group of regressors in this
  367. 19:11case we wouldn't call this D but rather
  368. 19:15X1 to have perfect symmetry between all
  369. 19:17the
  370. 19:21regressors now the coefficients are
  371. 19:23still named asymmetrically let's fix
  372. 19:26this we just call the gamma beta
  373. 19:301 now the alpha is really sticking out
  374. 19:34let's rename the alpha to Beta
  375. 19:37KN this is the generic form of linear
  376. 19:40regression and we'll use it when we talk
  377. 19:42about properties that hold for all
  378. 19:45linear
  379. 19:46regressions as we've just seen you're
  380. 19:48free to change this notation and to
  381. 19:50adapt it to suit the needs of your
  382. 19:53specific application for example you can
  383. 19:56rename the coefficient as we've just
  384. 19:59done you can also rename the
  385. 20:02regresses here we've used simple symbols
  386. 20:05for the regressors which is great
  387. 20:08because it makes for a very compact
  388. 20:10notation but it also makes it very easy
  389. 20:12to forget what these regressors
  390. 20:15represent
  391. 20:17economically often we will use more
  392. 20:19descriptive variable
  393. 20:20names let me demonstrate this in the
  394. 20:23context of our example at the same time
  395. 20:25I'll also demonstrate how to write down
  396. 20:28a specific linear regression model that
  397. 20:30you are considering for your analysis on
  398. 20:33the left hand side we put the outcome
  399. 20:35variable y except maybe we don't want to
  400. 20:38call it why we want to explain what it
  401. 20:40is let's call it test
  402. 20:43score now we put the M function here but
  403. 20:48instead of writing M we plug in the
  404. 20:51linear form here beta KN plus beta 1 and
  405. 20:56now we put our X1 very variable in our
  406. 20:59case that was D but to make it easier to
  407. 21:02understand what d stands for let's write
  408. 21:04class
  409. 21:06size plus beta
  410. 21:082 and instead of X2 let's write PD
  411. 21:15index finally X3 is the cohort
  412. 21:19size lastly we put the error term let me
  413. 21:23make some room
  414. 21:26first now we can add the error
  415. 21:29term now we have Rewritten our model for
  416. 21:32test score
  417. 21:35production in standard notation for
  418. 21:37linear regression you're very likely to
  419. 21:40see a linear model like this one in a
  420. 21:42research paper by an empirical
  421. 21:44Economist here we have retained the
  422. 21:47standard naming convention for the
  423. 21:48coefficients we don't have to do that
  424. 21:51for example here maybe we want to call
  425. 21:53the slope coefficient on class size
  426. 21:55gamma just to make it more obvious that
  427. 21:57this the treatment effect that we want
  428. 21:59to
  429. 22:00estimate our linear regression model
  430. 22:02here describes how test scores are
  431. 22:04produced in the population that we are
  432. 22:07studying the beta coefficients are
  433. 22:10unknown values the next step in our
  434. 22:13journey will be to try to estimate these
  435. 22:15values from
  436. 22:18data but this is the topic for another
  437. 22:20video thanks for watching

About this transcript

This page contains the full transcript of Linear regression for economists: The linear model. by MetricsProf, generated from the public captions YouTube serves with the video. The transcript has 2,538 words across 437 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 choose a caption track available on the video.

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, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.