set more 1
insheet using http://pped.org/dcsch/mgp.csv, clear
sort school_name
g o=_n             
g N11=min(n_fay_students_reading_2011,n_fay_students_math_2011)
g N12=min(n_fay_students_reading_2012,n_fay_students_math_2012)
g N=min(N11,N12)
su N11, d
g LowN11=N11<=r(p25) if N11<.
g MidN11=N11>r(p25) & N11<r(p75) if N11<.
g HigN11=N11>=r(p75) if N11<.
g LowN12=N12<=r(p25) if N12<.
g MidN12=N12>r(p25) & N12<r(p75) if N12<.
g HigN12=N12>=r(p75) if N12<.
expand 3
bys o: g x=_n     
g x2=cond(x==1,mgp_lowerlimit_reading_2012,mgp_upperlimit_reading_2012 ) if x<3
g x1=cond(x==1,mgp_lowerlimit_reading_2011,mgp_upperlimit_reading_2011 ) if x<3
cap mkdir ex1
forv i=1/177 {
 tw rarea mgp_upperlimit_math_2012 mgp_lowerlimit_math_2012 x2 if o!=`i', cmiss(n) fc(none) fin(100) lcol(gs15) lw(vvthin)||sc mgp_math_2012 mgp_reading_2012 if lea_c==1& o!=`i' &LowN12==1, msize(small) mcol(gs6)||sc mgp_math_2012 mgp_reading_2012 if lea_c==1& o!=`i'&MidN12==1, msize(medium) mcol(gs5)||sc mgp_math_2012 mgp_reading_2012 if lea_c==1& o!=`i'&HigN12==1, msize(medlarge) mcol(gs5)||sc mgp_math_2012 mgp_reading_2012 if lea_c!=1& o!=`i'&LowN12==1, msize(small) mcol(ebblue)||sc mgp_math_2012 mgp_reading_2012 if lea_c!=1& o!=`i'&MidN12==1, msize(medium) mcol(ebblue)||sc mgp_math_2012 mgp_reading_2012 if lea_c!=1& o!=`i'&HigN12==1, msize(medlarge) mcol(ebblue)||rarea mgp_upperlimit_math_2012 mgp_lowerlimit_math_2012 x2 if o==`i', fc(none) fin(60) lcol(orange) lw(medthick) cmiss(n)||sc mgp_math_2012 mgp_reading_2012 if o==`i' &LowN12==1, mcol(orange) msize(small) ||sc mgp_math_2012 mgp_reading_2012 if o==`i' &MidN12==1, mcol(orange) msize(medium)||sc mgp_math_2012 mgp_reading_2012 if o==`i' &HigN12==1, mcol(orange) msize(medlarge) leg(off) name(y2s`i', replace) title("{bf:2012}",  tsty(heading)) graphr(fc(white)) xla(0(10)100, nogrid) yla(0(10)100, nogrid) xti(" " "Reading",  tsty(heading)) yti(" " "Math",  tsty(heading)) || function y=50, ra(0 100) lcol(black) lw(vthin) || function 50000*(x-49.999), ra(49.999 50.001) lcol(gs6) lw(vthin) ysc(noline) xsc(noline) plotr(margin(zero) ilw(none) lsty(grid))
 tw rarea mgp_upperlimit_math_2011 mgp_lowerlimit_math_2011 x1 if o!=`i', cmiss(n) fc(none) fin(100) lcol(gs15) lw(vvthin)||sc mgp_math_2011 mgp_reading_2011 if lea_c==1& o!=`i' &LowN11==1, msize(small) mcol(gs6)||sc mgp_math_2011 mgp_reading_2011 if lea_c==1& o!=`i'&MidN11==1, msize(medium) mcol(gs5)||sc mgp_math_2011 mgp_reading_2011 if lea_c==1& o!=`i'&HigN11==1, msize(medlarge) mcol(gs5)||sc mgp_math_2011 mgp_reading_2011 if lea_c!=1& o!=`i'&LowN11==1, msize(small) mcol(ebblue)||sc mgp_math_2011 mgp_reading_2011 if lea_c!=1& o!=`i'&MidN11==1, msize(medium) mcol(ebblue)||sc mgp_math_2011 mgp_reading_2011 if lea_c!=1& o!=`i'&HigN11==1, msize(medlarge) mcol(ebblue)||rarea mgp_upperlimit_math_2011 mgp_lowerlimit_math_2011 x1 if o==`i', fc(none) fin(60) lcol(orange) lw(medthick) cmiss(n)||sc mgp_math_2011 mgp_reading_2011 if o==`i' &LowN11==1, mcol(orange) msize(small) ||sc mgp_math_2011 mgp_reading_2011 if o==`i' &MidN11==1, mcol(orange) msize(medium)||sc mgp_math_2011 mgp_reading_2011 if o==`i' &HigN11==1, mcol(orange) msize(medlarge) leg(off) name(y1s`i', replace) title("{bf:2011}",  tsty(heading)) graphr(fc(white)) xla(0(10)100, nogrid) yla(0(10)100, nogrid) xti(" " "Reading",  tsty(heading)) yti(" " "Math",  tsty(heading)) || function y=50, ra(0 100) lcol(black) lw(vthin) || function 50000*(x-49.999), ra(49.999 50.001) lcol(gs6) lw(vthin) ysc(noline) xsc(noline) plotr(margin(zero) ilw(none) lsty(grid))
 su lea_c if o==`i', mean
 loc sys=cond(r(mean)==1, "DCPS", "Charter")
 levelsof school_name if o==`i', loc(t)     
 loc tt:di `t'
 gr combine y1s`i' y2s`i', ycommon xcommon title(`"{bf:`tt' (`sys') highlighted in orange}"', pos(11) just(left) col(edkblue)) name(s`i', replace) graphr(fc(gs15)) xsize(8) ysize(4) graphr(fc(white)) 
 gr export ex1/sch`i'.png, replace width(1200) height(600)
 file close _all
 file open s`i' using ex1/s`i'.html, write replace 
 file write s`i' `"<html><head><meta charset="utf-8" /><title>School Quality</title><link href="style.css" rel="stylesheet" /></head>"'
 file write s`i' _n `"<body><center><table bgcolor="#FFFFFF" width=800><tr><td>Public schools in DC have <a href="http://dcps.dc.gov/DCPS/Files/downloads/ABOUT%20DCPS/FINAL%202013%20DC%20NAEP%20Results%20One-Pager%5B1%5D.pdf">gained ground on national tests</a> over the <a href="http://jaypgreene.com/2012/01/12/a-closer-look-at-dc-naep-scores/">last 15 years</a>,"'
 file write s`i' _n `"but much of that gain is due to the changing demographic composition of DC's student body. The income and education of parents is one of the primary determinants of student performance, and as DC residents have gotten better-off, so have incoming students' scores. Comparing NAEP scores over time without accounting"'
 file write s`i' _n `"for incoming class scores is mere <a href="http://greatergreatereducation.org/post/18672/bad-advocacy-research-abounds-on-school-reform/">jackaNAEPery</a>, and comparing proficiency levels is no better.</p>"'
 file write s`i' _n `"<p>The best measure of school quality is how much students learn: their improvement from incoming to outgoing scores, not how well they test at just one point in time."'
 file write s`i' _n `"<a href="http://www.urban.org/publications/411290.html">Measuring how much students learn over time is difficult</a>, and both teacher impact evaluations and school-specific test score growth measures compare only how well students in DC "'
 file write s`i' _n `"public schools do relative to other students in DC public schools. This leads to relative rankings only, not measures of how DC public schools as a whole are improving.</p>"'
 file write s`i' _n `"<p>The <a href="http://osse.dc.gov/sites/default/files/dc/sites/osse/release_content/attachments/DC%20Schoolwide%20Growth%20Data%20Report_0.pdf">median growth percentile (MGP)</a>  can give us an idea of how much a given school improves students' scores relative to other schools (relativism is characteristic of <a href="http://www.caldercenter.org/publications/upload/WP-80_2.pdf">other measures of value added by schools</a> as well). Each student's growth percentile score is equal to the percentage of comparable students district-wide who performed worse on a later math and reading exam. The school's score is then the typical student's score."'
 file write s`i' _n `"</p><p>The main problem is that these scores are fraught with measurement error, so rarely can we say with confidence that one school is better than another school. For example, Bancroft was in the top third on math MGP for 2011-12 and H.D. Cooke was in the bottom third, but the two math MGP scores are statistically indistinguishable (the margins of error overlap)."'                                                                                                                                                                                                                                                                                                                                                   
 file write s`i' _n `"</p><p>The graph below shows each school's math versus reading MGP scores for 2011 and 2012. A box around each dot indicates the range of statistically indistinguishable values for both math and reading in that year (2013 data were not released with the ranges). This way, we can compare the score both to other schools and to the typical school with a score of 50 (whose dot would be at the intersection of the math and reading lines at 50). Each school's box overlaps with the boxes of many other schools, and any two schools whose boxes touch are statistically indistinguishable. Whenever we compare schools, we should remain appropriately skeptical about the relative strengths of signal and noise in these data.</p>"'
 file write s`i' _n `"<br><img src=sch`i'.png alt="`tt' (`sys') scores shown compared to all other schools" height=300></p><center>"' 
 file write s`i' `"<nav><ul><li><font face="Helvetica">Choose a name from the list below if you want to highlight another school's data in orange</font><ul>"'   
 forv j=1/177 {
  su lea_c if o==`j', mean
  loc sys=cond(r(mean)==1, "DCPS", "Charter")
  qui levelsof school_name if o==`j', loc(s)     
  loc ss:di `s'
  file write s`i' `"<li><a href="s`j'.html">`ss'</a></li>"'   
  }
 file write s`i' `"</ul></li></ul></nav>"'   
 file write s`i' _n `"</center><p>So what <em>can</em> we say? Charter schools (in blue) tend to have higher growth scores, but traditional public schools are overrepresented at both the highest and lowest ranks. The main difference between the sectors is that charters tend not"'
 file write s`i' _n `"to be observed among the lowest performing schools, suggesting that <a href="http://www.urban.org/publications/1001499.html">the worst charters are better than the worst traditional public schools</a>.</p>"'
 file write s`i' _n `"<p>But there are surprises in both sectors. For example, what is the best high school in town? Ranked by the MGP for math, it is <a href="http://www.thurgoodmarshallacademy.org/about">Thurgood Marshall Academy</a>"'
 file write s`i' _n `"(Charter), east of the Anacostia, with <a href="http://profiles.dcps.dc.gov/McKinley+Technology+High+School">McKinley Technical High School</a> (DCPS) in Eckington running"'
 file write s`i' _n `"a close second. Only a handful of other high schools are statistically better than average on math in both years, but the sought-after high schools Woodrow Wilson and School Without Walls are not on that list.</p>"'
 file write s`i' _n `"<p>Among elementary schools, the top performers are scattered around the city, for example Ross in <span class=SpellE>Dupont</span>, Stanton in far Southeast DC, Tubman in Columbia Heights, Watkins on Capitol Hill, and Stoddert in Glover Park."'
 file write s`i' _n `"The top middle schools are the KIPP DC AIM and KEY Academies, with Cesar Chavez Prep and D.C. Prep Edgewood Middle charters not far behind. The highly regarded Deal Middle School barely squeaks out a statistical advantage over the typical school.</p>"'
 file write s`i' `"</td></tr></table></center></body></html>"'   
 discard
 }
file close _all
exit

M
aking work pay and
taking steps to help bridge the gap bet
ween
the
high
cost of living
and low wages
for
low
-
income
residents will help increase economic mobility and lessen
inequality. Policy proposals such as
an
expanded Earned Income Tax Credit
and
higher
personal
exemptions and
standard
deductions
in the i
nco
me tax
can
help
low
-
income
residents take home more of what they earn.
Investing in training programs to help close
literacy and skills gaps can help residents obtain some of the jobs the District is creating.
Lastly,
expanding the supply of
affordable housing stock
,
better access to subsidized health
insurance
, and other supports for low
-
income residents
will help alleviate the high costs
associated with living in a large city and
help preserve
the economic diversity of DC
. 
