- IPUMS
- Statistics Canada Public Use Microdata on Health topics
- Afrobarometer
- Our World in Data
- Bureau of Labor Statistics' National Longitudinal Survey of Youth (NLSY)
- Youth Risk Behavior Surveillance System (YRBSS)
- Innovations for Poverty Action (IPA) data repository
- Data is Plural, a weekly newsletter of useful/curious datasets
- USAID DHS Program: Demographic and Health Surveys
- Access to real data requires application that takes a few days to process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zero-Clause BSD | |
=============== | |
Permission to use, copy, modify, and/or distribute this software for | |
any purpose with or without fee is hereby granted. | |
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL | |
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES | |
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE | |
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*! version 1.0 27jul2013 Michael Stepner, stepner@mit.edu | |
program define vam_datasim | |
version 11 | |
syntax , var_mu(real) var_w(real) delta(real) var_lambda(real) var_ind(real) num_teachers(integer) max_T(integer) max_C(integer) max_I(integer) /// | |
[teacher(name) year(name) class(name) score(name) /// | |
randomize_num_classes randomize_class_sizes randomize_class_years /// | |
debug] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Load Health Inequality Project data | |
use "https://healthinequality.org/dl/health_ineq_online_table_16.dta", clear | |
* Combine all information from 2001-2014 | |
isid gnd indv_pctile age age_at_d yod | |
collapse (mean) mortrate indv_inc [w=count], by(gnd indv_pctile age_at_d) | |
* Use income percentiles that approximate associate justice salary (~$213,900) | |
* https://en.wikipedia.org/wiki/Federal_judge_salaries_in_the_United_States |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*! 23mar2018 Michael Stepner | |
* Code released to public domain under CC0 license: https://creativecommons.org/publicdomain/zero/1.0/ | |
* Use it and adapt it as you like. | |
/*** Plot intergenerational mobility by Race x Gender for multiple races | |
***/ | |
* Load quintile transition matrices from Chetty, Hendren, Jones, and Porter (2018). http://www.equality-of-opportunity.org/data/ | |
use "http://www.equality-of-opportunity.org/data/race/table_2.dta", clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v 0.0.2 | |
d Michael Stepner, stepner@mit.edu | |
p 'yamlout': export key, value, and comment to a YAML file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dfpass = read.table("test_domainerror_pass.csv", header=TRUE, sep=",") | |
dffail = read.table("test_domainerror_fail.csv", header=TRUE, sep=",") | |
glm(mortrate ~ age_at_d, dfpass, family=binomial(link = "log"), weights=dfpass[, "count"]) | |
glm(mortrate ~ age_at_d, dffail, family=binomial(link = "log"), weights=dffail[, "count"], start=c(-10,0.1)) | |
glm(mortrate ~ age_at_d, dffail, family=binomial(link = "log"), weights=dffail[, "count"]) |