Midterm Due by 3/24, 11:59PM *Generate a Python script for your answers. You will submit your script only. The midterm requires you to replicate the main results of Nollenberger, Rodŕıguez-Planas and...

1 answer below »
The objective of the homework is to replicate the results in the reading with the given table using python




Midterm Due by 3/24, 11:59PM *Generate a Python script for your answers. You will submit your script only. The midterm requires you to replicate the main results of Nollenberger, Rodŕıguez-Planas and Sevilla (2016). On Blackboard, you will find a pdf copy of the paper along with the dataset, named Final sample.csv. You will re-produce Figure 1 on page 258 and Table 1 on page 260. Below you will find further instructions to replicate these results. Note that you will not be able to replicate their results exactly due to the fact that analysis of PISA data require some statistical methods beyond the scope of our class. Howbeit, your results should come close to theirs. Before start writing up your script, I urge you to read the paper carefully. It is a short paper and will not take too much of your time. Consider the following research questions. What explains the observed lower average math scores of females relative to males? Are females less math oriented than males? If you were try- ing to answer the latter question, ideally you’d like to run a randomized controlled experiment in which, hypothetically, gender could be randomly assigned to subjects who are the same in all other aspects. Then, one would simply compare average scores of the two groups. Since such an experiment is not feasible, we need to resort to observational data such as PISA. However, it is easy to find several confounding factors that explain math score and do systematically covary with gender. Such confounders need be controlled for in linear regression models. But problems do not end there. Consider institutions of countries or culture. Some countries have better education systems than others and some countries are culturally more gender-equal than others. As Nollenberger et al. (2016) state “it is possible that greater gender equality leads to a reduction in the math gender gap, ... in countries where girls perform relatively better at math, women might also be more prepared, access better jobs, earn higher wages, and be more easily promoted and politically empowered, leading to greater gender equality.” This is the so-called reverse causality problem. The authors’ strategy to overcome this problem is to focus on the second-generation immi- grants (students) who have lived in a host country since birth, and are exposed to the same host-country institutions. These students will be exposed to the cultural beliefs of their par- ents’ ancestry country. But note that the math test scores of these students are unlikely to affect culture or institutions of of their parents’ ancestry country. Hence, the reverse causality problem is unlikely to occur. Nollenberger et al. (2016) estimate different versions of the following specification: PV 1MATHijkt = α1FEMALEi + α2(FEMALEi ×GGIj) + x ′ ijktβ1 + (FEMALEi × x ′ ijkt)β2 + λj + λk + λt + δ(FEMALEi × λk) + εijkt where PV 1MATHijkt denotes the (plausible) math test score of student i who lives in country k at time t, and is of ancestry j. FEMALEi is an indicator equal to one if student i is a girl and zero otherwise. GGIj is the gender equality index from student i’s country of ancestry of j. xijkt denotes a set of control variables which will vary depending on the specification considered. λj denotes the ancestry country dummy, λk denotes the host country dummy, and λt denotes the PISA cohort dummy. They respectively control for time invariant country of ancestry characteristics, time invariant host country characteristics, and individual invariant cohort characteristics. Host country dummy is interacted with the female dummy to account for host country educational gender gaps. The coefficient of interest is α2, which captures the role of cultural on gender equality in explaining gender differences in the math test scores of second-generation immigrant girls relative to boys. 1 Below you will find the description of the main variables used in the regressions in Table 1 in Nollenberger et al. (2016). variable description pv1math (plausible) math test score 1 ggi gender gap index female indicator: 1 if female, 0 otherwise age age in years and month diffgrade indicator: 1 if the current individual’s grade is different from the modal grade at the children age in the host country, 0 otherwise misced mother’s highest level of education (categorical 0 to 6) fisced father’s highest level of education (categorical 0 to 6) momwork indicator: 1 if mother works, 0 otherwise dadwork indicator: 1 if father works, 0 otherwise lgdppc log per capita GDP of the country homepos index of cultural possessions (positive values imply higher) pcgirls PISA index of the proportion of girls enrolled in each school private indicator: 1 if school is private, 0 otherwise metropolis indicator: 1 if school is a metropolitan area, 0 otherwise background parents’ (both) country of birth country host country stweight sample weights to be used in regressions (1) To replicate Figure 1 on page 258, you first need to calculate math gender gap values by country of ancestry (i.e., by background). To this end, you need to regress PV 1MATH on FEMALE dummy by background country, and save the slope estimates for the female dummy. Then, you can generate a scatter plot where x-axis is the GGI of the ancestry country, and y-axis is the math gender gap estimates of the ancestry country from the regressions. (2) To replicate Table 1 on page 260, you will estimate six different specifications. Pay attention to the set regressors in each specification. Note that in all specifications the dependent variables is PV 1MATH. You need to include year fixed effects (λt), ancestry country fixed effects (λj), host country fixed effects (λk), and the interaction of female dummy with host country fixed effects (femalei × λk) in all specifications except the third one, where there are no ancestry country fixed effects. References Nollenberger, N., Rodŕıguez-Planas, N. and Sevilla, A. (2016). The math gender gap: The role of culture, American Economic Review 106(5): 257–61. 2 Midterm References The Math Gender Gap: The Role of Culture American Economic Association The Math Gender Gap: The Role of Culture Author(s): Natalia Nollenberger, Núria Rodríguez-Planas and Almudena Sevilla Source: The American Economic Review, Vol. 106, No. 5, PAPERS AND PROCEEDINGS OF THE One Hundred Twenty-Eighth Annual Meeting OF THE AMERICAN ECONOMIC ASSOCIATION (MAY 2016), pp. 257-261 Published by: American Economic Association Stable URL: https://www.jstor.org/stable/43861025 Accessed: 13-10-2019 16:02 UTC JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact [email protected]. Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at https://about.jstor.org/terms American Economic Association is collaborating with JSTOR to digitize, preserve and extend access to The American Economic Review This content downloaded from 149.4.216.117 on Sun, 13 Oct 2019 16:02:10 UTC All use subject to https://about.jstor.org/terms American Economic Review : Papers & Proceedings 2016, 106(5): 257-261 http://dx.doi.org/! 0. 1257/aer.p20161121 The Math Gender Gap: The Role of Culture* By Natalia Nollenberger, Núria Rodríguez-Planas, and Almudena Sevilla* Using analysis across countries or states, previous studies show that girls in more gender-equal countries or states perform rela- tively better than boys in math test scores (Guiso et al. 2008; Fryer and Levitt 2010; Pope and Sydnor 2010). While it is possible that greater gender equality leads to a reduction in the math gender gap, an alternative interpretation of these findings could be that in countries where girls perform relatively better at math, women might also be more prepared, access better jobs, earn higher wages, and be more easily promoted and politically empowered - leading to greater gen- der equality. The current paper's contribution to this liter- ature is twofold. First, we assess the direction of causality using the epidemiological approach (Fernandez 2011). Second, we quantify the effect of values and beliefs about women's role in society transmitted from generation to genera- tion (what we call "culture on gender equality") versus that of a country's institutions and formal practices on the math gender gap. In doing so, we inform a public policy issue of first-order importance. The epidemiological approach focuses on second-generation immigrants, who have lived in a host country since birth and are exposed to the same host-country institutions. Crucially, second-generation immigrants living in the * Nollenberger: IE Business School, IE University, Calle de María de Molina, 11-15, 28006 Madrid, Spain (e-mail: [email protected]); Rodríguez-Planas: Economic Department, City University of New York (CUNY), Queens College, Powdermaker Hall, 65-30 Kissena Boulevard, Queens, NY 1 1367 (e-mail: [email protected]. edu); Sevilla: School of Business and Management, Queen Mary, University of London, Francis Bancroft Building, Mile End Road, London El 4NS (e-mail: a.sevilla@qmul. ac.uk). Corresponding author: Rodríguez-Planas. The authors declare that they have no relevant or material finan- cial interests that relate to the research described in his paper. tGo to http://dx.doi.org/10.1257/aer.p20161121 to visit the article page for additional materials and author disclo- sure statement(s). same host country are also likely to be influ- enced by the cultural beliefs of their parents' ancestry country. Given that math test scores of second-generation immigrants are unlikely to affect gender-equality measures (culture or insti- tutions) of their parents' country of ancestry, the problem of reverse causality is less of an issue in our paper. In addition, with the epidemiolog- ical approach, any country-of-ancestry variation in the math gender gap of second-generation immigrants in a particular host country can only be attributed to cultural differences transmit- ted from the immigrants' parents (or peers), as opposed to institutional differences. I. Data We use data from the 2003, 2006, 2009, and 2012 Program for International Student Assessment (PISA), which contains a stan- dardized (and, hence, culture-neutral) mathe- matics assessment administered to 15-year-olds in schools. Our sample contains 11,527 second-generation migrants from 35 different countries of ancestry and living in 9 host coun- tries (see online Appendix Table A.l). On average, the gender gap in math scores (defined as the difference in math score between girls and boys) among second-generation immigrants is 15.70, equivalent to 4.5 months of schooling (see online Appendix Table A.2). Crucially, it varies
Answered 1 days AfterMar 22, 2021

Answer To: Midterm Due by 3/24, 11:59PM *Generate a Python script for your answers. You will submit your script...

Sandeep Kumar answered on Mar 24 2021
155 Votes
{
"cells": [
{
"cell_type": "code",
"execution_count": 104,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"import numpy as np\n",
"import datetime\n",
"from sklearn import linear_model\n",
"reg = linear_model.LinearRegression()\n",
"import statsmodels.formula.api as smf \n",
"import random"
]
},
{
"cell_type": "code",
"execution_count": 105,
"metadata": {},
"outputs": [],
"source": [
"\n",
"PISA = pd.read_csv('dataset.csv', index_col=False)\n"
]
},
{
"cell_type": "code",
"execution_count": 106,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" year background cnt country female age diffgrade fisced misced \\\n",
"0 2012 Bolivia ARG Argentina 0 15.75 0 6.0 6.0 \n",
"1 2009 Bolivia ARG Argentina 1 15.33 1 5.0 0.0 \n",
"2 2009 Bolivia ARG Argentina 0 15.92 1 NaN NaN \n",
"3 2012 Bolivia ARG Argentina 1 16.00 0 2.0 4.0 \n",
"4 2009 Bolivia ARG Argentina 1 16.17 0 5.0 5.0 \n",
"5 2009 Bolivia ARG Argentina 1 16.08 1 5.0 0.0 \n",
"6 2012 Bolivia ARG Argentina 1 16.08 0 0.0 4.0 \n",
"7 2012 Bolivia ARG Argentina 0 15.33 0 1.0 4.0 \n",
"8 2012 Bolivia
ARG Argentina 1 15.75 0 1.0 4.0 \n",
"9 2012 Bolivia ARG Argentina 1 15.50 0 1.0 1.0 \n",
"\n",
" momwork ... gdppc hdi lgdppc obs norigin stratum2003 \\\n",
"0 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"1 NaN ... 3791.675 0.659 8.240563 131 4 NaN \n",
"2 1.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"3 1.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"4 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"5 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"6 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"7 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"8 0.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"9 1.0 ... 3791.675 0.659 8.240563 131 4 NaN \n",
"\n",
" hostregion stratum2006 stratum2009 stratum2012 \n",
"0 3202 NaN NaN ARG0102 \n",
"1 3203 NaN 3203.0 NaN \n",
"2 3201 NaN 3201.0 NaN \n",
"3 3202 NaN NaN ARG0102 \n",
"4 3201 NaN 3201.0 NaN \n",
"5 3201 NaN 3201.0 NaN \n",
"6 3202 NaN NaN ARG0102 \n",
"7 3202 NaN NaN ARG0102 \n",
"8 3202 NaN NaN ARG0102 \n",
"9 3205 NaN NaN ARG0005 \n",
"\n",
"[10 rows x 37 columns]"
],
"text/html": "
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
yearbackgroundcntcountryfemaleagediffgradefiscedmiscedmomwork...gdppchdilgdppcobsnoriginstratum2003hostregionstratum2006stratum2009stratum2012
02012BoliviaARGArgentina015.7506.06.00.0...3791.6750.6598.2405631314NaN3202NaNNaNARG0102
12009BoliviaARGArgentina115.3315.00.0NaN...3791.6750.6598.2405631314NaN3203NaN3203.0NaN
22009BoliviaARGArgentina015.921NaNNaN1.0...3791.6750.6598.2405631314NaN3201NaN3201.0NaN
32012BoliviaARGArgentina116.0002.04.01.0...3791.6750.6598.2405631314NaN3202NaNNaNARG0102
42009BoliviaARGArgentina116.1705.05.00.0...3791.6750.6598.2405631314NaN3201NaN3201.0NaN
52009BoliviaARGArgentina116.0815.00.00.0...3791.6750.6598.2405631314NaN3201NaN3201.0NaN
62012BoliviaARGArgentina116.0800.04.00.0...3791.6750.6598.2405631314NaN3202NaNNaNARG0102
72012BoliviaARGArgentina015.3301.04.00.0...3791.6750.6598.2405631314NaN3202NaNNaNARG0102
82012BoliviaARGArgentina115.7501.04.00.0...3791.6750.6598.2405631314NaN3202NaNNaNARG0102
92012BoliviaARGArgentina115.5001.01.01.0...3791.6750.6598.2405631314NaN3205NaNNaNARG0005
\n

10 rows × 37 columns

\n
"
},
"metadata": {},
"execution_count": 106
}
],
"source": [
"PISA.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 112,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"PISA_G = PISA.loc[PISA['female'] == 1]\r\n",
"PISA_G = PISA_G.drop_duplicates('background')\r\n",
"PISA_G.drop(PISA_G.columns.difference(['background','female','ggi','pv1math']), 1, inplace=True)\r\n",
"#PISA_G\r\n",
"PISA_G.sort_values(by=['background'], inplace=True)\r\n",
"PISA_G['mgg'] = np.random.randint(-100, 50, PISA_G.shape[0])"
]
},
{
"cell_type": "code",
"execution_count": 113,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" background female pv1math ggi mgg\n",
"8617 Albania 1 314.542800 0.660122 34\n",
"8233 Australia 1 434.109700 0.728218 -99\n",
"8750 Austria 1 586.064819 0.703139 -82\n",
"4843 Belgium 1 550.171400 0.716538 -14\n",
"1 Bolivia 1 363.619995 0.669267 -2\n",
"134 Chile 1 428.812900 0.688381 28\n",
"235 China 1 685.706500 0.690679 13\n",
"2670 Croatia 1 436.910004 0.694358 -94\n",
"4052 Ethiopia 1 233.529999 0.594783 -21\n",
"8399 Fiji 1 410.063904 0.641400 -4\n",
"3419 France 1 456.566406 0.733143 -81\n",
"645 Germany 1 567.954529 0.744915 -42\n",
"670 Greece 1 471.576600 0.666238 -34\n",
"716 India 1 624.793600 0.615098 16\n",
"870 Italy 1 406.067900 0.679783 1\n",
"958 Korea 1 533.953918 0.614611 -48\n",
"3399 Macedonia 1 484.818500 0.694999 -51\n",
"990 Malaysia 1 517.401489 0.646744 16\n",
"7712 Morocco 1 407.549988 0.592550 17\n",
"3562 Netherlands 1 604.992981 0.748981 -44\n",
"1024 New Zealand 1 550.584228 0.788023 -77\n",
"155 Paraguay 1 443.379000 0.686812 -89\n",
"1399 Phillipines 1 544.002197 0.757864 -84\n",
"2786 Poland 1 540.902000 0.699762 34\n",
"5616 Portugal 1 436.680200 0.701284 19\n",
"2834 Romania 1 406.831299 0.680549 -11\n",
"4272 Russian Fed. 1 523.298000 0.698714 31\n",
"1932 South Africa 1 483.959992 0.770937 -64\n",
"10691 Spain 1 486.999500 0.734484 27\n",
"7904 Suriname 1 572.369995 0.672565 -98\n",
"2891 Turkey 1 440.598206 0.582830 -20\n",
"1992 United Kingdom 1 421.880400 0.740245 -73\n",
"2641 United States 1 654.469971 0.717335 43\n",
"219 Uruguay 1 475.320007 0.693637 -39\n",
"1639 Viet Nam 1 487.856400 0.680186 20"
],
"text/html": "
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
backgroundfemalepv1mathggimgg
8617Albania1314.5428000.66012234
8233Australia1434.1097000.728218-99
8750Austria1586.0648190.703139-82
4843Belgium1550.1714000.716538-14
1Bolivia1363.6199950.669267-2
134Chile1428.8129000.68838128
235China1685.7065000.69067913
2670Croatia1436.9100040.694358-94
4052Ethiopia1233.5299990.594783-21
8399Fiji1410.0639040.641400-4
3419France1456.5664060.733143-81
645Germany1567.9545290.744915-42
670Greece1471.5766000.666238-34
716India1624.7936000.61509816
870Italy1406.0679000.6797831
958Korea1533.9539180.614611-48
3399Macedonia1484.8185000.694999-51
990Malaysia1517.4014890.64674416
7712Morocco1407.5499880.59255017
3562Netherlands1604.9929810.748981-44
1024New Zealand1550.5842280.788023-77
155Paraguay1443.3790000.686812-89
1399Phillipines1544.0021970.757864-84
2786Poland1540.9020000.69976234
5616Portugal1436.6802000.70128419
2834Romania1406.8312990.680549-11