In short, when a value of edu is missing, it reports:
Whilst if values of edu are indeed not unique within pid, no error message is reported, where I would expect one.
This is version version 1.0.1 31oct2015, the most current version of vlookup, and on Stata 15.1.
Edit:
Tagging user Kevin Crow (StataCorp) here
Apologies, not from SSC, source is:
multiple observations with different edu within pid.
This is version version 1.0.1 31oct2015, the most current version of vlookup, and on Stata 15.1.
Edit:
Tagging user Kevin Crow (StataCorp) here
Apologies, not from SSC, source is:
Code:
net install vlookup, from(http://www.stata.com/users/kcrow/)
Code:
* This runs fine clear input pid mother_id edu 3115572 19556 40 27313 19556 10 19556 . 20 end vlookup mother_id, gen(mother_edu) key(pid) value(edu) * where "value(edu)" is missing, a difficult to understand error message is reported about the uniqueness of edu within pid * I would simply expect missing values to be assigned clear input pid mother_id edu 3115572 19556 40 27313 19556 10 19556 . . end vlookup mother_id, gen(mother_edu) key(pid) value(edu) * where edu is not unique within pid, no error message is reported, vlookup simply assigns the last value of edu to mother_edu clear input pid mother_id edu 3115572 19556 40 27313 19556 10 19556 . 20 19556 . 10 19556 . 8 end vlookup mother_id, gen(mother_edu) key(pid) value(edu)
Comment