{"schemaVersion":2,"id":"panel","title":"Panel Data: Fixed & Random Effects","totalStages":30,"modules":[{"id":"panel-heterogeneity","title":"1 · Panel data & unobserved heterogeneity","summary":"What panel data is, why repeated observations on the same entities help, and how an unobserved entity effect αᵢ creates correlation that biases naive regression.","stageCount":6,"stages":[{"id":"panel-heterogeneity-01","index":0,"moduleId":"panel-heterogeneity","moduleIndex":0,"type":"read","title":"What makes data 'panel' data","skillIds":["panel.panel-structure"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-heterogeneity-02","index":1,"moduleId":"panel-heterogeneity","moduleIndex":1,"type":"read","title":"Why αᵢ is dangerous: unobserved heterogeneity","skillIds":["panel.pooled-bias"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-heterogeneity-03","index":2,"moduleId":"panel-heterogeneity","moduleIndex":2,"type":"code","title":"Build a balanced panel and look at it","skillIds":["panel.panel-structure"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-heterogeneity-04","index":3,"moduleId":"panel-heterogeneity","moduleIndex":3,"type":"quiz","title":"Check: what is αᵢ?","skillIds":["panel.pooled-bias"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-heterogeneity-05","index":4,"moduleId":"panel-heterogeneity","moduleIndex":4,"type":"quiz","title":"Check: when does αᵢ cause bias?","skillIds":["panel.panel-structure"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-heterogeneity-06","index":5,"moduleId":"panel-heterogeneity","moduleIndex":5,"type":"fillblank","title":"Name the hidden entity effect","skillIds":["panel.pooled-bias"],"estimatedMinutes":4,"difficulty":"advanced","points":15}]},{"id":"panel-pooled-bias","title":"2 · Pooled OLS and its bias","summary":"Pooled OLS ignores the panel structure and treats αᵢ as part of the error. We show, in code and with a slider, that this biases β₁ whenever αᵢ correlates with x.","stageCount":6,"stages":[{"id":"panel-pooled-bias-01","index":6,"moduleId":"panel-pooled-bias","moduleIndex":0,"type":"read","title":"Pooled OLS: pretend the panel is one big cross-section","skillIds":["panel.within-estimator"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-pooled-bias-02","index":7,"moduleId":"panel-pooled-bias","moduleIndex":1,"type":"code","title":"Pooled OLS overshoots the true slope","skillIds":["panel.fe-inference"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-pooled-bias-03","index":8,"moduleId":"panel-pooled-bias","moduleIndex":2,"type":"read","title":"Why the pooled line tilts too steeply","skillIds":["panel.within-estimator"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-pooled-bias-04","index":9,"moduleId":"panel-pooled-bias","moduleIndex":3,"type":"interactive","title":"Slider: dial the αᵢ–x correlation","skillIds":["panel.fe-inference"],"estimatedMinutes":8,"difficulty":"advanced","points":10},{"id":"panel-pooled-bias-05","index":10,"moduleId":"panel-pooled-bias","moduleIndex":4,"type":"quiz","title":"Check: direction of the bias","skillIds":["panel.within-estimator"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-pooled-bias-06","index":11,"moduleId":"panel-pooled-bias","moduleIndex":5,"type":"fillblank","title":"Pooled OLS: inefficient, or worse?","skillIds":["panel.fe-inference"],"estimatedMinutes":4,"difficulty":"advanced","points":15}]},{"id":"panel-fixed-effects","title":"3 · Fixed effects: within transformation & entity dummies","summary":"Fixed effects estimate β₁ from within-entity variation only, sweeping out αᵢ. We do it two equivalent ways — entity dummies and hand-coded demeaning — and confirm both kill the bias.","stageCount":9,"stages":[{"id":"panel-fixed-effects-01","index":12,"moduleId":"panel-fixed-effects","moduleIndex":0,"type":"read","title":"The within transformation: subtract each entity's mean","skillIds":["panel.random-effects"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-fixed-effects-02","index":13,"moduleId":"panel-fixed-effects","moduleIndex":1,"type":"code","title":"Method A — entity dummies","skillIds":["panel.hausman"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-fixed-effects-03","index":14,"moduleId":"panel-fixed-effects","moduleIndex":2,"type":"code","title":"Method B — demean by hand, then OLS","skillIds":["panel.random-effects"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-fixed-effects-04","index":15,"moduleId":"panel-fixed-effects","moduleIndex":3,"type":"interactive","title":"Slider: pooled drifts, fixed effects holds","skillIds":["panel.hausman"],"estimatedMinutes":8,"difficulty":"advanced","points":10},{"id":"panel-fixed-effects-05","index":16,"moduleId":"panel-fixed-effects","moduleIndex":4,"type":"quiz","title":"Check: why no constant?","skillIds":["panel.random-effects"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-fixed-effects-06","index":17,"moduleId":"panel-fixed-effects","moduleIndex":5,"type":"quiz","title":"Check: what FE cannot estimate","skillIds":["panel.hausman"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-fixed-effects-07","index":18,"moduleId":"panel-fixed-effects","moduleIndex":6,"type":"fillblank","title":"Name the transformation","skillIds":["panel.random-effects"],"estimatedMinutes":4,"difficulty":"advanced","points":15},{"id":"panel-fixed-effects-08","index":19,"moduleId":"panel-fixed-effects","moduleIndex":7,"type":"truefalse","title":"Can FE price a fixed trait?","skillIds":["panel.hausman"],"estimatedMinutes":3,"difficulty":"advanced","points":10},{"id":"panel-fixed-effects-09","index":20,"moduleId":"panel-fixed-effects","moduleIndex":8,"type":"truefalse","title":"Smaller SEs, so use RE?","skillIds":["panel.random-effects"],"estimatedMinutes":3,"difficulty":"advanced","points":10}]},{"id":"panel-random-effects","title":"4 · Random effects & choosing FE vs RE","summary":"Random effects treats αᵢ as random noise uncorrelated with x, gaining efficiency and time-invariant coefficients — but only if that assumption holds. The Hausman idea tells you which to trust.","stageCount":9,"stages":[{"id":"panel-random-effects-01","index":21,"moduleId":"panel-random-effects","moduleIndex":0,"type":"read","title":"Random effects: αᵢ as a random draw","skillIds":["panel.dynamic-panel"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-random-effects-02","index":22,"moduleId":"panel-random-effects","moduleIndex":1,"type":"code","title":"Random effects via MixedLM (αᵢ ⟂ x)","skillIds":["panel.dynamic-panel"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-random-effects-03","index":23,"moduleId":"panel-random-effects","moduleIndex":2,"type":"code","title":"Now break RE's assumption: αᵢ correlates with x","skillIds":["panel.dynamic-panel"],"estimatedMinutes":10,"difficulty":"advanced","points":10},{"id":"panel-random-effects-04","index":24,"moduleId":"panel-random-effects","moduleIndex":3,"type":"read","title":"The Hausman idea: let the gap decide","skillIds":["panel.dynamic-panel"],"estimatedMinutes":6,"difficulty":"advanced","points":5},{"id":"panel-random-effects-05","index":25,"moduleId":"panel-random-effects","moduleIndex":4,"type":"interactive","title":"Slider: watch FE and RE diverge","skillIds":["panel.dynamic-panel"],"estimatedMinutes":8,"difficulty":"advanced","points":10},{"id":"panel-random-effects-06","index":26,"moduleId":"panel-random-effects","moduleIndex":5,"type":"quiz","title":"Check: reading the Hausman result","skillIds":["panel.dynamic-panel"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-random-effects-07","index":27,"moduleId":"panel-random-effects","moduleIndex":6,"type":"quiz","title":"Check: when RE wins","skillIds":["panel.dynamic-panel"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-random-effects-08","index":28,"moduleId":"panel-random-effects","moduleIndex":7,"type":"quiz","title":"Hausman rejects RE — now what?","skillIds":["panel.dynamic-panel"],"estimatedMinutes":5,"difficulty":"advanced","points":15},{"id":"panel-random-effects-09","index":29,"moduleId":"panel-random-effects","moduleIndex":8,"type":"truefalse","title":"RE by default?","skillIds":["panel.dynamic-panel"],"estimatedMinutes":3,"difficulty":"advanced","points":10}]}]}
