Skip to content

Instantly share code, notes, and snippets.

@bbdaniels
Last active January 8, 2020 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbdaniels/0fd4742717991d185a697875e88bf254 to your computer and use it in GitHub Desktop.
Save bbdaniels/0fd4742717991d185a697875e88bf254 to your computer and use it in GitHub Desktop.
Mincer regression for Econ lecture
clear // Reset the work space
set obs 100000 // Create empty units of observation
set seed 837169 // Fix randomization start point
// Generate ability scores 0-100
gen theta = 100*runiform()
// Fix parameters
local a = 100
local b = 2
local c = 150
// Calculate educated and uneducated wages for everyone
gen w0 = theta
gen w1 = `a' + `b'*theta
// Everyone chooses education optimally
gen edu = (w1 - `c') > w0
// Assign observed wages based on choices
gen w = w0 if edu == 0
replace w = w1 if edu == 1
// Naive estimate of differences
reg w edu
// Calculate true return for all people
gen dif = w1-w0
sum dif // Average true return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment