Jason Becker
August 21, 2013

In December 2009, the education department head, Professor Kenneth K. Wong, another graduate student and myself were part of a three-person team consulting the Rhode Island Department of Education (RIDE) on how to establish a new state funding formula. We worked with finance and legal staff at the department to develop the legislation for the 2010 session that would establish a state funding formula for the first time in 15 years. 
 The Board of Regents had already passed a resolution with its policy priorities that they wanted enshrined in the formula. Additionally, there had been many attempts over the past 5-10 years to pass a new formula that failed for various reasons, chief among them that all previously proposed formulas were accompanied with a call to increase state funding for education 30-50%, with some even envisioning nearly doubling the state education funding. Our task was to research funding formulas, both in practice in other states and in the literature research on school finance, and achieve the goals of the Board of Regents without proposing a mammoth increase in state aid that would sink the entire endeavor 1. The general sense was that while more state aid had the potential to improve the progressiveness of education expenditures, the reality is the overall spending level in Rhode Island is high, and introducing new money was less important than redistributing state aid. I share this belief, particularly because I think adding money to the right places is simple once there is already a way to equitably distribute those funds. Tying up the increase in funding alongside a distribution method is a recipe for political horse-trading that can result in all kinds of distortions that prevent aid from flowing where needed.


My role in this process was primarily to create Excel simulators that would allow us to immediately track the impacts of changing different parts of the formula. I also helped RIDE staff interpret the meaning of changes to the math behind the funding formula and understand what levers existed to change the formula and how these changes impacted both the resulting distribution and policy.


We had three months.


There are a lot of people who are unhappy about the results of the formula that ultimately passed in June 2010. Because we are redistributing essentially the same amount of state aid, there are some districts that are losing money while others are gaining funds 2. Some dislike the fact that we used only a “weight” for free and reduced price lunch status. Alternative formulas (and formulas in other states) typically include numerous weights, from limited English proficiency and special education status, to gifted and talented and career and technical education 3. And yet others were displeased that many costs, including transportation and facilities maintenance, were excluded from the state-base of education aid. Then there are those who think the transition is all off– five years is too long to wait to get the increases the formula proposes, and ten years is far too fast to lose the money the formula proposes. 4

A Good State Aid System


In the end, I am proud of the formula produced for several reasons.
 First, it passed successfully and has been fully funded (and sometimes more than fully funded) each year of implementation throughout a period of massive structural budget deficits. This is no small accomplishment. The advocacy community rightfully pushes us to build ideal systems, but in our role of policy entrepreneurs we are faced with the reality that a policy that does not become law and is not supported as law may as well not exist. Producing a formula that has some of the other positive qualities discussed below, passing that formula, and implementing the formula with little fanfare is not a small accomplishment.


Second, the formula is highly progressive, sending as much as 20 times more aid to some of our poorest communities in Rhode Island compared to the wealthiest. I am not positive how this compares to other states– that’s a topic I certainly want to work on for a future post– but with just 39 cities and towns, it seems to show a high preference for vertical equity, treating different cities and towns differently. There are communities on both ends of the distribution who want substantially more state funding, and our state aid formula is not sufficient to effectively crowd out local capacity for education spending and ensure that our poorest communities are spending more than our wealthier ones 5, but it’s a very strong start.


Third, the formula is relatively simple. While I do not necessarily agree that it is a virtue to have fewer weights and a simple formula in perpetuity, the experience with other states and other formula-based programs show that weights and complexities are very easy to add and very hard to take away. Once a particular policy preference is enshrined in the distribution method, it had better be right because a community of advocacy will maintain that weight long into the future. Personally, I felt it critical to start with the very simple “core” formula that could be adjusted over time. I have some ideas on how I might modify/add to this core that I will be sharing in this post, but I firmly believe that starting with a simple core was the right move. It is also worth noting that because of the need to ensure the transition is smoothed out so that gains in some districts equal the total losses in the others meant that even a more progressive weighting scheme would not impact school funding until the far back end of the transition period (which we proposed as 7 years but was pushed to 5 years during the legislative process), since communities were already gaining funds as fast as we could move them. For this reason, not only was a simple core preferable from my technocratic perspective, but it also was not likely to have any immediate downside.


Fourth, we removed the long-term regionalization bonuses. Rhode Island had sought to reduce the ridiculous number of school districts by providing a bonus for regionalizing in the early 90s. Unfortunately, because of the timing of the abandonment of the previous state aid formula, the districts that did choose to regionalize had their base funding locked in at a level 6-8% higher than it should have been, because they were receiving a bonus that was meant to fade away over the course of several years. I could justify a small increase in state funding to pay some of the transition expenses of regionalizing districts, but long term funding increases? Part of the goal of regionalization is the reduction of overhead that allows for decreased costs (or increased services at the same costs). There is no ongoing need to supply a massive state bonus for regionalizing.


Now just because I am proud of this work does not mean that I think we have “solved” education funding in Rhode Island. Personally, I believe there are other defensible ways to distribute funding in Rhode Island, each of which represents slightly different policy preferences. There is no hard and fast “right” or “wrong” way to do this, within certain guidelines. As I see it, so long as the formula is progressive and moving toward a greater chance of seeing a day where Providence has the highest paid staff in the state 5, we are on the right path. I don’t believe that Rhode Island will have a truly “great” education finance climate without a substantial growth in the economy or a huge new tax that dramatically lowers the ability of municipalities to generate school funding while bolstering state aid. However, I think we have a great foundation and a “good” system.


For the remainder of this post, I would like to propose a few ideas that could help move Rhode Island from “good” to “very good” that I think are feasible within the next five years 6.


A Very Good State Aid Program


After a little over three years since its establishment, I think we are ready to tackle several additional aspects of state education funding in Rhode Island. One thing you may notice is that few of these ideas impact the original formula. Part of why that is comes from my aforementioned preference for a simple formula, and part is because these include some non-formula issues that were not pursued in 2010 in an effort to keep the focus on the main policy matters.
 First, and perhaps the most consequential change that can be made to state funding, is the teacher pension fund payments. Currently, the state and local districts split the cost of teacher pension contributions 60/40. This is a flat split, regardless of the wealth of the community. I think it’s absurd to ignore community wealth for such a large portion of state education expenditures. Using the Adjusted Equalized Weighted Assessment Values (AEWAV) to determine the reimbursement rates would be a big improvement on the progressiveness of school funding.


Second, I would make a slight change to the way that we fund charter schools. When we were developing the formula, there was broad agreement among policymakers that the “money should follow the child”. In one sense, this is the system we proposed since school district funding is based on enrollments. However, I think an irrational desire to not “double count” students, alongside the need to keep funding as flat as possible, pushed the formula a bit too far when it comes to charters. The old way of funding charter schools allowed districts to hold back 5% of the total per pupil expenditure from their charter school tuitions. This meant charter schools received 5% less funding than traditional public schools, but it also recognized that there are some fixed costs in districts that are not immediately recoverable when students leave on the margins. I think the state should return to this practice, however only if the state is willing to pay the withheld 5% to charters. I do think its fair to take into account some fixed costs, but I don’t believe it’s fair that charter schools received less funding as a result.


Third, we excluded all building maintenance costs from the base amount of state aid. This was largely because the formula was supposed to represent only the marginal instructional costs associated with each student. I don’t necessarily think that these costs have to be added into the base amount. However, I would like to see the state contribute to the maintenance of buildings more directly. I think the state should provide a flat dollar amount, say $100,000, per building in each district, provided that key criteria are met. The buildings should be at 90% occupancy/utilization, should have a minimum size set based on the research on efficiency (roughly 300 students at the elementary level and 600 students for high schools), and there should be some minimum standard for building systems quality and upkeep. These requirements are mostly about making sure this flat fund, which is really about the fixed costs of maintaining buildings, doesn’t create incentives to build more. It may seem inconsequential, but I think it’s important to state the preference for well-sized, occupied 7, and maintained buildings is worthwhile.


I think it’s wrong that the minimum reimbursement rate for school construction aid was raised to 40% during the funding formula debates in the General Assembly. This amounts to a massive subsidy for suburban schools and the previous 30% minimum is part of why we have such stark facilities inequities in the state. We should remove the minimums on construction reimbursement and simply use AEWAV to determine the reimbursement rate. Also, we need to establish a revolving facilities loan fund, much like the one used for sewers (and now roads and bridges). Access to lower interest bonds should not be dependent on city finances.


Fourth, one thing we did not include in the original funding formula that has come under considerably criticism is a special weight for students who are labeled English language learners. There are a few reasons we made this decision. The districts that have ELLs are the same districts that have high levels of poverty. In fact, the five communities that had more than 5% of their students classified as ELLs were, in order, also the top five districts with regards to free and reduced price lunch eligibility. Combined with a transition plan that was already increasing funding to these districts as rapidly as could be afforded, there were virtually no short-term consequences of not including an ELL weight. It’s worth noting that formula dollars are not categorical funds– there are no restrictions on how districts should spend this money, and there are no guarantees that an ELL weight would have any impact on ELL spending.


We were also concerned with incentivizing over-identification and failing to exit students who should no longer be classified as ELLs. I am also personally concerned with mistaking the additional supports we want to target as needed for English language acquisition; it would not only inspire the wrong policies and supports for these students, but it fails to recognize a host of needs that persist for these students well beyond English acquisition.


During the funding formula hearings at House and Senate Finance Committees we discussed the need for further study on this issue. I think that the next weight in the formula should be based on the Census and American Communities Survey. By using these data sets, classification of students who are eligible for the weight would not be dependent on the school district itself. Rather than focus on child language acquisition, I think we should broaden this weight to be applied based on the percentage of households that speak a language other than English in the home, where English is spoken at a level below “very well” 8. This would ensure that students who live in language minority households receive additional supports throughout their education, regardless of their language acquisition status. I would make this weight lower than some in the literature because it would apply to a broader set of students, probably somewhere around 40% like the poverty weight. For reference, the latest five-year estimate from the ACS data shows that 24.3% of households fit this definition in the city of Providence. With a 40% weight, at 22,500 students, with a foundation amount of around $9,000 per student, this weight would increase funding to Providence by a little over $16,000,000. Similar to other formula aid, these funds would be unrestricted.


Now, while I think that $16,000,000 is no small potatoes, and I am happy to express our policy preference to drive funding into communities where families are not using English in the home, some perspective is warranted. Providence will receive almost $240,000,000 in state aid when the formula is fully transitioned, compared to about $190,000,000 before. Adding this weight would only represent a 6% increase in state aid from the full formula amount. It’s an important increase, but I hope you’ll forgive me if I felt it was not grossly unfair to exclude it in the first iteration of the funding formula, especially considering we still have not fully transitioned to those higher dollar amounts sent to districts that would benefit from these funds.


It Takes Money


Each of these recommendations, in my view, would improve the way that Rhode Island distributes education aid. Some of the changes are technical, others address areas that are currently not considered, and some are purely about increasing the progressiveness of aid. All of these changes will require an even greater state contribution to education aid, but these increases would be an order of magnitude lower than what it would take to increase the state aid to covering 50-60% of all education expenditures. While I would support some pretty radical changes to drive more money into the state aid system, I think that each of these improvements are worth doing on the path to increased aid.



  1. I should note, that few people I spoke to were not in favor of raising the amount of state aid. We all want more money to come from the state because those dollars are far more progressive. However, Rhode Island was deep in its recession at this point in time and the dollar amounts to make a real dent in the state to local share in education are just staggering. Rhode Island currently funds just short of 40% of total school expenditures at the state level. To increase that to 60%, which is closer to the national average, they would have to contribute $500M more– a roughly 60% increase from the current level. Just for some context, the main tax fight of Rhode Island progressives has been to repeal tax cuts for higher income individuals that were instituted starting in 2006 in an attempt to move toward a flat income tax rate in Rhode Island. The impact of this repeal would be an increase in revenues that would cover roughly 10% of the increase in school funding required to move from 40% to 60% state aid. Of course, those dollars are supposed to pay for some portion of restoring pension benefits, so it’s already spoken for. ↩︎

  2. Hold harmless provisions, when introduced in other states, serve to dramatically distort the redistributive properties of state aid and almost always require a huge influx of funds. In fact, a hold harmless provision in Rhode Island would have required a doubling of state aid, which ultimately would have guaranteed that wealthy communities continue to receive too much state aid while less wealthy communities are stuck fighting year after year for tremendous revenue increases through taxation just to get their fair share. Essentially, hold harmless would ensure that you never reach formula-level spending and guarantee that state aid would not be very progressive. ↩︎

  3. One very popular progressive member of the Rhode Island General Assembly had been working for years to pass a new funding formula and had five or six such weights in her version. Interestingly, with the glaring exception of sending $0 to Newport in state aid, the difference in the overall distribution of funds by district in Rhode Island using this formula and our formula was tiny, almost always <5%. ↩︎

  4. Smoothing the “gains” and “losses” overtime was important to keep the formula as close to revenue neutral as possible. Of course, there are increases due to inflation and other factors each year as a part of the base, but our goal was to truly redistribute the funds such that not only is the end number not a big increase in total state aid but that getting through the transition period did not have huge costs. If it did, there is no way we could feel confident we would ever reach the point where the formula actually dictated state aid, much like the hold harmless provision prevents a full transition. Modeling various transition plans was a nightmare for me. ↩︎

  5. Many people forget that education spending is about competition within a single market. Overall spending matters less within this market than how you spend compared to others. The trick is that an urban school primarily working with traditionally under served families needs to be able to pay not just for more material supplies, but mostly for higher quality teachers and staff (and perhaps quantity). Because of compensating wage differentials, even hiring teachers and staff that are the same quality as wealthy communities costs more. ↩︎ ↩︎

  6. Perhaps I will write a future post on some ideas of how to push Rhode Island to “great”, even though I view all of those solutions as politically impossible. ↩︎

  7. I would include any leased space as occupied. We should encourage full utilization of the buildings, whether that includes charter schools, central office use, city government, or private companies. ↩︎

  8. This definition is clunky, but its how the ACS and Census track these things. This definition is clunky, but its how the ACS and Census track these things. We could verify the data using the data reported by districts about language spoken in the home. I would recommend using this data point to assist with whether or not to include these weights for charter schools. For example, approximately half of those families that do not speak English in the home also speak English very poorly. Therefore, I might apply half of the weight to each individual child whose family reports speaking a language other than English at home. Of course, the actual proportion of the weight should be specific to the ratio of speakers of language other than English to non-very well speakers of English by community. ↩︎

August 14, 2013

This post originally appeared on my old blog on January 2, 2013 but did not make the transition to this site due to error. I decided to repost it with a new date after recovering it from a cached version on the web.

Rhode Island passed sweeping pension reform last fall, angering the major labor unions and progressives throughout the state. These reforms have significantly decreased both the short and long-run costs to the state, while decreasing the benefits of both current and future retirees.

One of the most controversial measures in the pension reform package was suspending annual raises 1 for current retirees. I have noticed two main critiques of this element. The first criticism was that ending this practice constitutes a decrease in benefits to existing retirees who did not consent to these changes, constituting a breach of contract and assault on property rights. This critique is outside of the scope of this post. What I would like to address is the second criticism, that annual raises are critical to retirement security due to inflation, especially for the most vulnerable pensioners who earn near-poverty level wages from their pensions.

While I am broadly supportive of the changes made to the pension system in Rhode Island, I also believe that it is important to recognize the differential impact suspending annual raises has on a retired statehouse janitor who currently earns $22,000 a year from their pension and a former state department director earning $70,000 a year from their pension. Protecting the income of those most vulnerable to inflation is a worthy goal 2.

I have a simple recommendation that I think can have a substantial, meaningful impact on the most vulnerable retirees at substantially less cost than annual raises. This recommendation will be attractive to liberals and conservatives, as well as the “business elite” that have long called for increasing Rhode Island’s competitiveness with neighboring states. It is time that Rhode Island leaves the company of just three other states– Minnesota, Nebraska, and Vermont– that have no tax exemptions for retirement income 3. Rhode Island should exempt all income from pensions and social security up to 200% of the federal poverty level from state income taxes. This would go a long way to ensuring retirement security for those who are the most in need. It would also bring greater parity between our tax code and popular retirement destination states, potentially decreasing the impulse to move to New Hampshire, North Carolina, and Florida.

It’s a progressive win. It’s a decrease in taxes that conservatives should like. It shouldn’t have a serious impact on revenues, especially if it goes a long way toward quelling the union and progressive rancor about the recent reforms. And it’s far from unprecedented– in fact, some form of retirement income tax exemption exists in virtually every other state.

We should not be proud of taking away our most vulnerable pensioners’ annual raises, even if it was necessary. Instead of ignoring the clear impact of this provision, my hope for 2013 is that we address it, while keeping an overall pretty good change to Rhode Island’s state retirement system.


  1. Not a cost-of-living adjustment, or COLA, as some call them. ↩︎

  2. Interesting, increases in food prices has largely slowed and the main driver of inflation are healthcare costs. I wonder to what extent Medicare/Medicaid and Obamacare shield retirees from rising healthcare costs ↩︎

  3. www.ncsl.org/documents… ↩︎

July 28, 2013

One of the most interesting discussions I had in class during graduate school was about how to interpret the body of evidence that existed about Teach for America. At the time, Kane, Rockoff and Staiger (KRS) had just published “What does certification tell us about teacher effectiveness? Evidence from New York City” in Economics of Education Review . KRS produced value-added estimates for teachers and analyzed whether their initial certification described any variance in teacher effectiveness at raising student achievement scores. The results were, at least to me, astonishing. All else being equal, there was little difference if teachers were uncertified, traditionally certified, a NYC teaching fellow, or a TFA core member.

Most people viewed these results as a positive finding for TFA. With minimal training, TFA teachers were able to compete with teachers hired by other means. Is this not a vindication that the selection process minimally ensures an equal quality workforce?

I will not be discussing the finer points of

[points out: scholasticadministrator.typepad.com/thisweeki…

July 22, 2013

CCSSI Mathematics posted a scathing look at the items released by the Smarter Balanced Assessment Consortium (SBAC). While the rest of the internet seems to be obsessed over Georgia leaving the Partnership for Assessment of College and Careers1, the real concern should be over the quality of these test items.

Although CCSSI also deligently point out questions that are not well aligned to the standards, this is the least of my worries. Adjusting the difficulty of items and better alignment is something that testing companies know how to do and deal with all the time. Computerized testing is the new ground and a big part of why states are, rightfully, excited about the consortium.

The problem with the SBAC items is they represent the worst of computerized assessment. Rather than demonstrating more authentic and complex tasks, they present convoluted scenarios and even more convoluted input methods. Rather than present multimedia in a way that is authentic to the tasks, we see heavy language describing how to input what amounts to multiple choice or fill-in the blank answers. What I see here is not worth the investment in time and equipment that states are being asked to make, and it is hardly a “next generation” set of items that will allow us to attain more accurate measures of achievement.

SBAC looks poised to set up students to fail because of the mechanations of test taking. This is not only tragic at face value, but assures an increase in test-prep as the items are less authentic.


  1. There was a lot of concern trolling over Georgia leaving PARCC by Andy Smarick on Twitter and Flypaper. I don’t really see this as devastating, nor do I think some kind of supplication to the Tea Party could have changed this. Short of federal mandating of common tests and standards, Georgia was never going to stay aligned with a consortium that includes Massachusetts. Georgia has an incredibly inexpensive testing program, because they have built really poor assessments that are almost entirely multiple choice. They also have some of the lowest proficiency standards in the country. There was no way this state would move up to a testing regime that costs more than twice as much (but is around the country median) that is substantially more complex and will have a much higher standard for proficiency. Georgia is one of those states that clearly demonstrates some of the “soft bigotry of low expectations” by hiding behind inflated proficiency due to low standards. ↩︎

This summer has been very productive for my fiction reading backlog. Here are just some of the things I have read since Memorial Day. 1

Novels

The Name of the Wind by Patrick Rothfuss

I picked up The Name of the Wind on a whim while cruising through the bookstore. I was glad I did. This book tells a classic story– a precocious young wizard learns to use his powers, building toward being the most important person in the world. The book is framed around an innkeeper and his apprentice who are more than they seem. When a man claiming to be the most famous storyteller in the land enters the inn, we learn that our innkeeper has past filled with spectacular exploits that our bard wants to record. Lucky for our reader, Kvothe, in addition to be a warrior-wizard of extraordinary talent, is a narcissist who decides to tell his whole story just this once to this most famous of all chroniclers. 2 Although I have spoken to several folks who found Kvothe to be utterly unlikeable because of both his sly form of arrogance and Rothfuss’s decision to seemingly make Kvothe worthy of such high self-worth, I loved this book.

In this first book of the The Kingkiller Chronicle (as these things tend to be named), we learn all about Kvothe’s formative years. We spend substantial time exploring dark times in Kvothe’s life when he endures tragedy, trauma, and horrible poverty before finally beginning to learn how to truly use his talents. It is a fair critique that Kvothe seems almost “too good”, but much of the story is about how skill, luck, and folly all contribute to his success and fame, much of which is based on exaggerated tellings of true events.

If you are a fan of this sort of fantasy, with magic, destiny, love, power, and coming of age, I recommend picking up this book. Rothfuss has a gift. The sequel, The Wise Man’s Fear is already available, and I will certainly be reading it before the end of the summer.

Endymion and The Rise of Endymion by Dan Simmons

Endymion and The Rise of Endymion are the must anticipated (15 years ago) follow up to Dan Simmons’s brilliant Hyperion and Fall of Hyperion. I strongly recommend the originals, which is one of the greatest tales in all of science fiction. I also recommend creating some distance between reading each set of books. Six years separate the publishing of these duologies. Each story is so rich, I think it is hard to appreciate if you read all four books in one go. Yet, the narrative is so compelling it might be hard to resist. I waited about one year between reading the original Cantos and this follow up and I was glad I did.

Set 272 years after the events of the original books, Endymion and The Rise of Endymion serve as crucial stories that satisfyingly close loops I did not even realize were open at the end of the originals. What was once a glimpse at future worlds and great cosmic powers now unfurl as major players, their primary motivations unveiled.

These books are so entwined with the original that I will not say anything about its plot so that there are no spoilers. What I can offer is the following. Whereas books 1 and 2 play with story structure to captivating effect, these books do not. Instead, we are treated to a uniquely omniscient narrator, who is both truly omniscient and integral to the events of the story. How he gains this omniscience is a major plot point that’s pulled off effortlessly. The first two books are framed as an epic poem, known as the Hyperion Cantos, written by one of the major characters in those events. Another thing we learn is the original Cantos is not entirely reliable. Their author, who as not omniscient, had to fill in some blanks to complete the story, and also failed to understand some of the “heady” aspects of what happened and was sloppy in their explanations. Thus, we are treated both to key future events and simultaneously charged with a new reading of the original novels as written by a less than reliable narrator. What is true and what is not will all be told in this excellent follow up.

A word to the wise– Simmons may feel a bit “mushy” in his message for some “hard” science fiction readers. I think there is both profound depth and beautiful presentation of ideas, both complex enough to “earn” this treatment and some simpler than the story seems to warrant.

The Rook

The Rook is a fantastically fun debut novel3 written by an Australian bureaucrat. I learned about this book from one of my favorite podcasts, The Incomparable. Episode 128: Bureaucracy was Her Superpower is an excellent discussion that you should listen to after reading this book. I feel the hosts of that show captured perfectly what made this book great– it was completely honest and fair to its reader.

It is not giving anything away to say that The Rook centers around a Myfanwy (mispronounced even by the main character as Miffany, like Tiffany with an M) who suddenly becomes aware of her troublesome surroundings but with complete amnesia. It would be easy to dismiss the memory loss as a trite plot driver, used as a cheap way to trick our characters and readers. But O’Malley is brilliant in his use of Myfanwy’s memory loss. This book does not lie to its reader or its characters. Memory loss does not conceal some simple literary irony. Instead, it serves to create a fascinating experience for a reader who learns to understand and love a character as she creates, understands, and learns to love herself.

Myfanwy is not just an ordinary young woman with memory loss. She’s a high ranking official in what can best be described as the British X-Men who run MI-5. And she knew her memory loss was imminent. As such, she prepared letters for her future, new self to learn all about her life and her attempts to uncover the plot that would lead to her own memory loss. Again, the letters could be seen as cheap opportunities for exposition and to create false tension, but O’Malley never holds too tight to their use as a structure. We read more letters at the beginning of the story, and fewer later on as the reader is availed of facts and back story as they become relevant, without a poorly orchestrated attempt to withhold information from the main character. Instead of assuming Myfanwy is reading along with us, we easily slip into an understanding that shortly after our story begins, Myfanwy actually takes the time to read all the letters and we, thankfully, are not dragged along for the ride blow by blow.

The Rook manages to tread space in both story and structure that should feel wholly unoriginal and formulaic but never becoming either. The powers of the various individuals are fascinating, original, and consequential. The structure of the book is additive, but the plot itself is not dependent on its machinations.

Most of all, The Rook is completely fun and totally satisfying. That’s not something we say often in a post-Sopranos, post-Batman Begins world.

The Ocean at the End of the Lane

Speaking of delightful, Neil Gaiman is at his best with The Ocean at the End of the Lane. Gaiman is the master of childhood, which is where I think he draws his power as a fantasy writer. He is able to so capture the imagination of a child in beautiful prose it is as thought I am transformed into an 8-year old boy reading by flashlight in bed late at night, anxious and frightened.

The Ocean at the End of the Lane is a beautiful, dark fairy tale. Our narrator has recently experienced a loss in the family that has affected him profoundly, such that he is driven to detour back to the home he grew up in. Most of us can appreciate how deep sadness can drive us toward spending some time alone in a nostalgic place, both mentally and physically, as we work through our feelings.

There, we are greeted with the resurfacing of memories from childhood when events most unnatural conspired to do harm against him and his family.

I really don’t want to say much from this book except that it is heartbreakingly beautiful in a way that only someone like Gaiman can manage. This is a book that should be read in just one or two sittings. It is profoundly satisfying for anyone who loves to read books that transform who and where they are. Gaiman achieves this completely.

Comics

Locke and Key

Joe Hill is a master of his craft. Over Memorial Day weekend there was a great Comixology sale that dramatically reduced the price of getting in on Locke and Key and I jumped right on board.

I have rarely cared so much for a set of characters, regardless of the medium.

Our main characters, the Locke family (three young children and their mother), are faced with tragedy in the very first panels of Welcome to Lovecraft, the opening volume of this six-part series. I think what makes Locke and Key unique is rather than use tragedy simply as the opportunity to produce heroism, our protagonists are faced with real, long lasting, deep, and horrifying consequences.

All the while, we are thrust into the fascinating world of Key House, the Locke family home where our main characters’ father grew up. Key House is home to magical keys each of which can open one locked door. Step through that door, and there are fantastical consequences like dying, becoming a spirit free to float around the house until your spirit returns through the door. One door might bring great strength, another flight.

It is not surprising that the tragedy that drives the Locke family back to Key House is deeply connected to the mysterious home’s history, and the very source of its magic. What is brilliant is how Joe Hill quietly reveals the greater plot through the every day misadventures of children who are dealing with a massive life change. These characters are rich, their world is fully realized, and the story is quite compelling. A must read.

Don’t believe me? The Incomparable strikes again with a great episode on the first volume of Locke and Key.

American Vampire

I was turned on to American Vampire by Dan Benjamin. Wow. Phenomenal. These are real vampires.

East of West

Saga


  1. Affiliate links throughout, if that kind of thing bugs you. If that kind of thing does bug you, could you shoot me an email and explain why? I admit to not getting all the rage around affiliate linking. ↩︎

  2. Learning more about our main character, I am somewhat dubious that this is the only time he has told of his exploits, although this older Kvothe may have become a lot less inclined to boasting. ↩︎

  3. Actually, The Rook is the second debut on this list. The Name of the Wind was Rothfuss’s first. ↩︎

June 19, 2013

The Economic Policy Institute has release a short issue brief on the Rhode Island Retirement Security Act (RIRSA) by Robert Hiltonsmith that manages to get all of the details right but the big picture entirely wrong.

The EPI Issue Brief details the differences between the retirement system for state workers before and after the passage of RIRSA as accurately and clearly as I have ever seen. Mr. Hiltonsmith has done a notable job explaining the differences between the new system and the old system.

The brief, unfortunately, fails by engaging in two common fallacies to support its broader conclusions. The first is the straw man fallacy. Mr. Hiltonsmith takes a limited set of the objectives of the entire RIRSA legislation and says defined contribution plans do not meet those objectives. That is true, but ignores the other objectives it does accomplish which were also part of the motivation behind RIRSA. The second is circular reasoning. In this case, Mr. Hiltonsmith states that the reason for a low funding ratio is because the state did not put 100% of its paper liability into the pension fund. This is a tautology and not in dispute and should not be trumpeted as a conclusion of analysis.

Here are his three main points that he believes makes RIRSA a bad policy:

  1. The defined contribution plan does not save the state money from its annual pension contributions.
  2. The defined contribution plan is likely to earn lower returns and therefore result in lower benefits for retirees.
  3. The defined contribution plan does not solve the low funding ratio of the pension plan which exists because law makers did not make required contributions.

Of course, the defined contribution portion of RIRSA was not in place to do any of these three things. The purpose of including a defined contribution plan in the new state pension system is to create stability in annual budget allocations and avoid locking the government into promises it has demonstrated it fails to keep. Defined benefit plans require the state to change pension contributions when there are market fluctuations and leads to anti-cyclical costs, where the state is forced to put substantially more resources into pensions when revenues are lowest and spending on social welfare is most important. The defined contribution plan keeps the payments required by the state consistent and highly predictable. This is far preferable from a budget perspective.

It is unfortunate that there are lower returns to defined contribution plans which may lead to a decrease in overall benefits. It is my opinion that the unions in Rhode Island should be pushing for a substantially better match on the defined contribution portion of their plan that more closely resembles private sector match rates. This could more than alleviate the difference in benefits while maintaining the predictability, for budgeting purposes, of the defined contribution plan. I doubt this policy would have much hope of passing while Rhode Island slowly crawls out of a deep recession, but it is certainly a reasonable matter for future legislatures.

There are only two ways to decrease the current pension fund shortfalls: increase payments to the fund or decrease benefits. There is no structural magic sauce to get around this. Structural changes in the pension system are aimed at reducing the likelihood that the state will reproduce its current situation, with liabilities well outstripping funds. It is true that the “savings” largely came from cutting benefits. I have not heard anyone claim otherwise. The only alternative was to put a big lump sum into the pension fund. That clearly was not a part of RIRSA.

It is absurd to judge RIRSA on the ability of defined contribution plans to achieve policy objectives that are unrelated to the purpose of this structural change.

Perhaps the most troubling conclusion of this brief was that,

The shortfall in Rhode Island’s pension plan for public employees is largely due not to overly generous benefits, but to the failure of state and local government employers to pay their required share of pensions’ cost.

I read that and expected to see evidence of skipped payments or a discussion of overly ambitious expectations for investment returns, etc. Instead, it seems that this conclusion is based simply on the fact that the benefits in Rhode Island were not deemed outrageously large, and therefore Rhode Island should just pay the liability hole. The “failure” here is predicated entirely on the idea that the pensions as offered should be met, period, whatever the cost to the government. This is the “required share”. Which, of course, is technically true without a change in the law, but feels disingenuous. It is essentially a wholesale agreement with the union interpretation of the state pension system as an immutable contract. The courts will likely resolve whether or not this is true. My objection is that Mr. Hiltonsmith makes a definitive statement on this rationale without describing it. In such a lucid description of how the retirement system has changed, it seems this could only be intentional omission intended to support a predetermined conclusion rather than illuminate the unconvinced.

Mr. Hiltonsmith also claims that, “Over the long term, RIRSA may cost the state upwards of $15 million a year in additional contributions while providing a smaller benefit for the average full-career worker.” I am not 100% certain, but based on his use of the normal cost 1 to do these calculations, it appears this conclusion is drawn only based on the marginal contributions to current employees. In other words, if we completely ignore the existing liability, the new plan cost the state more money marginally while potentially decreasing benefits for employees. It is my opinion that Mr. Hiltonsmith is intentionally creating the perception that RIRSA costs more than the current plan while providing fewer benefits. Again, this is true for future liabilities, but ignores that RIRSA also dramatically decreased the unfunded liabilities through cutting existing retiree benefits. So the overall cost for the act is far less, while the marginal cost was increased with the objective of decreasing the instability in government appropriations.

We can have a serious debate about whether there is value in the state goals of a defined contribution plan. In my view, the purpose of switching to this structure is about:

  1. Portability of plans for more mobile workers, potentially serving to attract younger and more highly skilled employees.
  2. Stability in government expenditures on retiree benefits from year to year that are less susceptible to market forces. This includes avoiding the temptation to reduce payments when there are strong market returns as well as the crushing difficulty of increasing payments when the market (and almost certainly government receipts) are down.
  3. Insulating workers from a government that perpetually writes checks they can cash, as was the case with the current system.

This paper does not address any of these objectives or others I might have forgotten. In essence, the brief looks at only one subset of the perceived costs of this structural change, but it is far from a comprehensive analysis of the potential universe of both costs and benefits. In fact, it fails to even address the most commonly cited benefits. That is why I view it as heavily biased and flawed, even if I might draw similar conclusions from a more thorough analysis.


  1. Definition: Active participants earn new benefits each year. Actuaries call that the normal cost. The normal cost is always reflected in the cash and accounting cost of the plan. Source In other words, the normal cost only looks at the new benefits added to the liability, not the existing liability. ↩︎

June 11, 2013

A few months back I wrote some code to calculate age from a date of birth and arbitrary end date. It is not a real tricky task, but it is certainly one that comes up often when doing research on individual-level data.

I was a bit surprised to only find bits and pieces of code and advice on how to best go about this task. After reading through some old R-help and Stack Overflow responses on various ways to do date math in R, this is the function I wrote 1:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
age_calc <- function(dob, enddate=Sys.Date(), units='months'){
  if (!inherits(dob, "Date") | !inherits(enddate, "Date"))
    stop("Both dob and enddate must be Date class objects")
  start <- as.POSIXlt(dob)
  end <- as.POSIXlt(enddate)
  
  years <- end$year - start$year
  if(units=='years'){
    result <- ifelse((end$mon < start$mon) | 
                      ((end$mon == start$mon) & (end$mday < start$mday)),
                      years - 1, years)    
  }else if(units=='months'){
    months <- (years-1) * 12
    result <- months + start$mon
  }else if(units=='days'){
    result <- difftime(end, start, units='days')
  }else{
    stop("Unrecognized units. Please choose years, months, or days.")
  }
  return(result)
}

A few notes on proper usage and the choices I made in writing this function:

  • The parameters dob and enddate expect data that is already in one of the various classes that minimally inherits the base class Date.
  • This function takes advantage of the way that R treats vectors, so both dob and enddate can be a single or multi-element vector. For example enddate is a single date, as is the default, then the function will return a vector that calculates the difference between dob and that single date for each element in dob. If dob and enddate are both vectors with n>1, then the returned vector will contain the element-wise difference between dob and enddate. When the vectors are of different sizes, the shorter vector will be repeated over until it reaches the same length as the longer vector. This is known as recycling, and it is the default behavior in R.
  • This function always returns an integer. Calculating age in years will never return, say, 26.2. Instead, it assumes that the correct behavior for age calculations is something like a floor function. For examle, the function will only return 27 if enddate is minimally your 27th birthday. Up until that day you are considered 26. The same is true for age in months.

This is probably the first custom function in almost 3 years using R that I wrote to be truly generalizable. I was inspired by three factors. First, this is a truly frequent task that I will have to apply to many data sets in the future that I don’t want to have to revisit. Second, a professional acquaintance, Jared Knowles, is putting together a CRAN package with various convenience functions for folks who are new to R and using it to analyze education data 2. This seemed like an appropriate addition to that package, so I wanted to write it to that standard. In fact, it was my first (and to date, only) submitted and accepted pull request on Github. Third, it is a tiny, simple function so it was easy to wrap my head around and write it well. I will let you be the judge of my success or failure 3.


  1. I originally used Sys.time() not realizing there was a Sys.Date() function. Thanks to Jared Knowles for that edit in preparation for a CRAN check. ↩︎

  2. Check out eeptools on Github. ↩︎

  3. Thanks to Matt’s Stats n Stuff for getting me to write this post. When I saw another age calculation function pop up on the r-bloggers feed I immediately thought of this function. Matt pointed out that it was quite hard to Google for age calculations in R, lamenting that Google doesn’t meaningfully crawl Github where I linked to find my code. So this post is mostly about providing some help to less experience R folks who are frantically Googling as both Matt and I did when faced with this need. ↩︎

June 4, 2013

Kevin Carey has a great new piece on his experience taking a Massive Open Online Course (MOOC). If you have any interest in blended learning, online education, and higher education policy, I would consider this a must read.

He carefully addresses many of the common concerns to online only course work. Can it be truly rigorous? Yes. Do you lose the “magic” of taking a big lecture course in person? Maybe, but there’s more magic in pressing pause and rewind on a video. Can you assess 40,000 students in a rigorous way? Yes.

Carey concludes that the cost of attending an institute of higher education, and of paying so many PhD instructors for lecture courses, is astronomically high considering the small value-add that arguably exists between the best online version of a course and what most professors and lecturers offer.

The implication for Carey is clear: online education done extremely well can be as effective as some university courses today, and most university courses tomorrow.

I agree that lectures in person are not better than online lectures. I also agree that intellectually stimulating conversation about content/material can happen online in forums, over video chats, using popular social networks, etc. I even agree that it is possible to do rigorous assessment in many domains 1. I am quite confident that a well-implemented MOOC could replace the typical college lecture course today on many campuses. The problem with MOOCs is not their ability to replicate the quality material aspects of a college course.

What is the Problem with MOOCs?

Carey spent 15 hours a week watching lectures, working through problem sets, and communicating with fellow students to complete the course work with satisfactory outcomes. Think about the amount of perseverance it takes to work that hard independently from a computer in your home. There is an entire world of books and webpages dedicated to helping upperclass, knowledge economy employees work productively from their home offices because while some thrive, many struggle to be productive. Professionals find they have to be careful to close their doors, set clear boundaries with family members around work hours, put on a suit and a tie like they are going into work, and not use the office for non-work activities, to name a few techniques, to ensure they are productive working remotely 2.

Non-traditional students, first-generation college students, and poor students are all likely to face challenges recreating effective work spaces. This is not a matter of bandwidth, quality computer access, or digital skills. All of these things are real challenges, but will disappear within the next decade. What’s not likely to change is the need for quiet, comfortable space to work seriously for hours on end, uninterrupted.

But these students will also miss out on another key part of what makes college an effective place for learning– you’re in a place that’s dedicated to learning surrounded by people dedicated to the same pursuit. When you see people every day who are walking into class 3 there is a sense that you are a part of a learning community. There is a pressure to succeed because you see the hard work of your peers. I truly believe that making going to class and studying a habit is greatly supported by being surrounded by that habit. Look no further than group study areas and coffee shops around universities to see tons of students, outside of their dorms and in pop up communal office. This is true even at Research I universities, even among students who do not share classes. Those students know how to use forums, social networking, instant messages and more.

I am not saying that college is about unexpected collisions of people or ideas in some nebulous way. I mean quite literally that being a good student is partly possible because you’re surrounded by students.

These supports are not irreplaceable. They do not require $50,000 a year. On this, I completely agree with Carey. But the reality is the students who will easily adapt and find substitute supports, regardless of cost, will not be the ones to use MOOCs at the start.

Community colleges are the major target with MOOCs. They are already struggling to stay low cost institutions, their faculty are generally less credentialed and have substantially less power than tenured faculty at research institutions. They also are less likely to be able to make the case that their lecture is world class. However, their students are the ones that have the most to lose.

Community college students are about to lose a critical support: the culture of being students with other students.

Academic preparation is frequently discussed when trying to predict college success, but I don’t think we should dismiss the importance of social integration. Only an extreme classist view could believe that MOOCs remove the need for social integration because the “institution” of traditional universities and colleges no longer exist. We will simply accomplish shifting the burden of a new, challenging integration to those who are already struggling.

A World of Free, Decentralized Higher Education

I am also concerned with a future where MOOCs are broadly available, very inexpensive, and degrees are not considered important. This may seem like an ideal end stage, where skill and knowledge are what is rewarded and the “gatekeepers” to traditional power have fallen.

Yet, this highly market-driven future is likely to continue to exacerbate the difference between the haves and have-nots, a decidedly poor outcome. Education markets struggle from information failures. Need more here

Proceed with Caution

I am honestly thrilled about MOOCs. I just feel more cautious about their public policy implications in the immediate term. Let’s start with rigorous experiments and lowering the costs at our most elite institutions before we decide to “solve” remedial course work and the higher education system writ large in one fell swoop.


  1. Certainly in the STEM fields. It may be more challenging to address humanities and social sciences that are heavy on writing. ↩︎

  2. Yes, many people think it’s crazy that folks find it challenging to work from home. I promise you, this is a real thing, mostly experience by people who have actually tried working from home. Hence, coworking and other solutions. ↩︎

  3. Not just your class, and not just from dorm rooms but also from cars. ↩︎

June 1, 2013

Apple will be revealing new details for both of its major operating systems at WWDC on June 10, 2013. The focus of much speculation has been how Apple will improve multi-tasking and inter-app communication in iOS7. As batteries have grown, CPUs have become increasingly powerful, and the application ecosystem has matured 1, the iOS sandboxing model has felt increasingly limiting and outdated.

I think that there is a simple change that could dramatically increase the effectiveness of multitasking on iOS by re-examining how application switching works.

Scrolling through a long list of applications, either through the basement shelf or via the four-finger gesture on an iPad, is both slow and lacking in contextual cues. In a simple case where I am working with two applications simultaneously, how do I switch between them? The list of open applications always places the current application in the first position. The previously used application sits in the second position. The first time I want to change to another application this is not so bad. I move to the “right” on the list to progress forward into the next application 2.

The trouble comes when I want to return to where I was just working. The most natural mental model for this switch is to move “left” in the list. I moved “right” to get here and millions of years of evolution has taught me the the “undo button” for moving right is to move left 3. But of course, when I attempt to move “left”, I find no destination 4. I can pop an application from anywhere on the list, but I can only prepend new applications to the list 5.

Apple needs to move away from its linear thinking and enter the second dimension.

What if I could drag apps in the switcher on top of each other to make a new stack, not unlike the option on the OS X launch bar? Throughout this stack, position is maintained regardless of which application is in use/was last used. I can always move up from Chrome to ByWord, and down to Good Reader, for example, if I was writing a report. Apple might call this a Stack, mirroring the term in OSX, but I would prefer this to be called a Flow.

The goal of this feature is to organize a Flow for a particular task that requires using multiple apps. One feature might be saving a “Flow”, this way each time I want to write a blog post, I tap the same home screen button and the same four apps in the same order launch in a Flow, ready for easy switching using the familiar four-finger swipe gesture up and down. I no longer have to worry about the sequence I have recently accessed applications which is confusing and requires me to look at the app switcher draw or needlessly and repeatedly swipe through applications. I never have to worry about lingering too long on one application while swiping through and switching to that app, changing my position to the origin of the list and starting over again.

For all the calls for complex inter-app communication or having multiple apps active on the screen at the same time, it seems a simple interface change to application switching could complete change the way we multitask on iOS.


  1. And Federico Viticci has either shown us the light or gone completely mad. ↩︎

  2. For now, lets assume the right application is next in the stack. I’ll get to that issue with my second change. ↩︎

  3. You are in a green room. > Go east. You are in a red room. > Go west. You are in a green room. ↩︎

  4. You can't go that way. ↩︎

  5. I don’t know enough about data structures yet to name what’s going on here. I am tempted to think that the challenge is they have presented a list to users, with a decidedly horizontal metaphor, when they actually have created something more akin to a stack, with a decidedly vertical metaphor. But a stack isn’t quite the right way to understand the app switcher. You can “pop” an app from any arbitrary position on the app switcher, but funny enough can only push a new app on to the top of the switcher. ↩︎

May 29, 2013

One thing I really dislike about Google Reader is it replaces the links to posts in my RSS feed. My Pinboard account is littered with links that start with http://feedproxy.google.com. I am quite concerned that with the demise of Google Reader on July 1, 2013, these redirects will no longer work.

It’s not just Google that obscures the actually address of links on the internet. The popularity of using link shortening services, both to save characters on Twitter and to collect analytics, has proliferated the Internet of Redirects.

Worse still, after I am done cutting through redirects, I often find that the ultimate link include all kinds of extraneous attributes, most especially a barrage of utm_* campaign tracking.

Now, I understand why all of this is happening and the importance of the services and analytics this link cruft provides. I am quite happy to click on shortened links, move through all the redirects, and let sites know just how I found them. But quite often, like when using a bookmarking service or writing a blog post, I just want the simple, plain text URL that gets me directly to the permanent home of the content.

One part of my workflow to deal with link cruft is a TextExpander snippet I call cleanURL. It triggers a simple Python script that grabs the URL in my clipboard, traces through the redirects to the final destination, then strips links of campaign tracking attributes, and ultimately pastes a new URL that is much “cleaner”.

Below I have provided the script. I hope it is useful to some other folks, and I would love some recommendations for additional “cleaning” that could be performed.

My next task is expanding this script to work with Pinboard so that I can clean up all my links before the end of the month when Google Reader goes belly up.

:::python
#!/usr/bin/python
import requests
import sys
from re import search
from subprocess import check_output

url = check_output('pbpaste')

# Go through the redirects to get the destination URL
r = requests.get(url)

# Look for utm attributes
match =  search(r'[?&#]utm_', r.url)

# Because I'm not smart and trigger this with
# already clean URLs
if match:
  cleanURL = r.url.split(match.group())[0]
else:
  cleanURL = r.url

print cleanURL
December 19, 2012

Update: Please see below for two solutions.

I have grown increasingly unhappy with Wordpress lately. My blog is simple. My design tastes are simple. My needs are simple. I like control. I am a geek. And I really need an excuse to learn Python, which seems to be rapidly growing into one of the most important programming languages for a data analyst.

I have decided to migrate this blog over to Pelican, a static site generator written in Python. Static sites are the “classic” way to do a webpage– just upload a bunch of HTML and CSS files, maybe some Javascript. But no databases and no constructing the page a user sees in the browser as they request it. This puts substantially less strain on a web server and makes it far easier to export and move a webpage since all you need to do is duplicate files. What makes static sites a real pain is that there is a lot of repetition. Folks adopted dynamic sites that use content management system so that they can write a page called “post.php” one time, and for each unique post just query a database for the unique content. The frame around the post, layout, components, etc are all just written once. Static site generators allow you to build a webpage using a similar, but far more stripped down, layout system. However, rather than generate each page on the web server, you generate each page by running a script locally that transforms plain text documents into well-formed HTML/CSS. Then you can just upload a directory and the whole site is ready to go.

Pelican comes with a pretty good script that will take Wordpress XML that’s available via the built-in export tools and transform each post into a reStructuredText files, a format similar to Markdown. I prefer Markdown so I used pandoc to convert all my *.rst posts into *.md files.

So far, so good.

But one of the really big problems I had with Wordpress was a growing dependency on plugins that added non-standard, text-based markup in my posts that would be rendered a particular way. For example, text surrounded by two parenthesis, [^0], became a footnote. For code syntax highlighting, I use a “short code”, which puts sourcecode language='r', for example, between brackets []. All of these plugins have been great, but now when you try to export a post you get the non-standard markup in-line as part of your posts. It makes it very difficult to recreate a post the way it looks today.

This presents a great opportunity to learn a little Python. So I have begun to scrounge together some basic Python knowledge to write some scripts to clean up my Markdown files and convert the syntax of the short codes that I have used to properly formatted Markdown so that when I run the pelican script it will accurately reproduce each post.

Unfortunately, I’ve hit a snag with my very first attempt. Footnotes are a big deal to me and have standard Markdown interpretation. In Markdown, footnotes are inserted in the text where [^#] appears in the text, where # = the footnote identifier/key. Then, at the end of the document, surrounded by new lines, the footnote text is found with [^#]: footnote text where # is the same identifier. So I needed to write a script that found each instance of text surrounded by two parentheses, insert the [^#] part in place of the footnote, and then add the footnote at the bottom of the post in the right format.

I created a test text file:

1
2
3
This is a test ((test footnote)).
And here is another test ((footnote2)). Why not add a third? ((Three
Three)).

The goal was to end up with a file like this:

1
2
3
4
5
6
7
8
This is a test [^1]. And here is another
test [^2]. Why not add a third? [^3].

[^1]: test footnote

[^2]: footnote2

[^3]: Three Three

Unfortunately, the output isn’t quite right. My best attempt resulted in a file like this:

1
2
3
4
5
6
7
8
This is a test [^1] And here is another te[^2])). Why not add a
t[^3]ree)).

[^1]: ((test footnote))

[^2]: ((footnote2))

[^3]: ((Three Three))

Ugh.

So I am turning to the tiny slice of my readership that might actually know Python or just code in general to help me out. Where did I screw up? The source to my Python script is below so feel free to comment here or on this Gist. I am particularly frustrate that the regex appears to be capturing the parenthesis, because that’s not how the same code behaves on PythonRegex.com.

If anyone can help me with the next step, which will be creating arguments that will understand an input like *.rst and set the output to creating a file that’s *.md, that would be appreciated as well.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import re

p = re.compile("\(\(([^\(\(\)\)]+)\)\)")
file_path = str(raw_input('File Name >'))
text = open(file_path).read()

footnoteMatches = p.finditer(text)

coordinates = []
footnotes = []

# Print span of matches
for match in footnoteMatches:
    coordinates.append(match.span())
    footnotes.append(match.group())

for i in range(0,len(coordinates)):
    text = (text[0:coordinates[i][0]] + '[^' + str(i+1)+ ']' +
            text[coordinates[i][1]+1:])
    shift = coordinates[i][1] - coordinates[i][0]
    j = i + 1
    while j < len(coordinates):
        coordinates[j] = (coordinates[j][0] - shift, coordinates[j][1] - shift)
        j += 1

referenceLinkList = [text 1="'
'" language=","][/text]
for i in range(0, len(footnotes)):
    insertList = ''.join(['\n', '[^', str(i+1), ']: ', footnotes[i], '\n'])
    referenceLinkList.append(insertList)

text = ''.join(referenceLinkList)

newFile = open(file_path, 'w')
newFile.truncate()
newFile.write(text)
newFile.close()

Update with solutions:

I am happy to report I now have two working solutions. The first one comes courtesy of James Blanding who was kind enough to fork the gist I put up. While I was hoping to take a look tonight at his fork tonight, Github was experiencing some downtime.  So I ended up fixing the script myself a slightly different way (seen below). I think James’s approach is superior for a few reasons, not the least of which was avoiding the ugly if/elif/else found in my code by using a global counter. He also used .format() a lot better than I did, which I didn’t know existed until I found it tonight.

I made two other changes before coming to my solution. First, I realized my regex was completely wrong. I didn’t want to capture anything within the two parenthesis when no parenthesis were contained, as the original regex did. Instead, I wanted to make sure to preserve any parenthetical comments contained within my footnotes. So the resulting regex looks a bit different. I also switched from using user input to taking in the filepath as an argument.

My next step will be to learn a bit more about the os module which seems to contain what I need so that this Python script can behave like a good Unix script and know what to do with one file or a list of files as a parameter (and of course, most importantly, a list generated from a wild card like *.rst). I will also be incorporating the bits of James’s code that I feel confident I understand and that I like better.

Without further ado, my solution (I updated the gist as well):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 from sys import argv
import re

name, file_path = argv

p = re.compile(r"[\s]\(\((.*?[)]{0,1})\)\)[\s]{0,1}")
# The tricky part here is to match all text between "((""))", including as 
# many as one set of (), which may even terminate ))). The {0,1} captures as
# many as one ). The trailing space is there because I often surrounded the 
# "((""))" with a space to make it clear in the WordPress editor.

# file_path = str(raw_input('File Name >'))
text = open(file_path).read()

footnoteMatches = p.finditer(text)

coordinates = []
footnotes = []

# Print span of matches
for match in footnoteMatches:
    coordinates.append(match.span())
# Capture only group(1) so you get the content of the footnote, not the 
# whole pattern which includes the parenthesis delimiter.
    footnotes.append(match.group(1))

newText = []
for i in range(0, len(coordinates)):
    if i == 0:
        newText.append(''.join(text[:coordinates[i][0]] +
                               ' [^{}]').format(i + 1))
    elif i < len(coordinates) - 1 :
        newText.append(''.join(text[coordinates[i-1][1]:coordinates[i][0]] +
                          ' [^{}]').format(i + 1))
    else:
        newText.append(''.join(text[coordinates[i-1][1]:coordinates[i][0]] +
                          ' [^{}]').format(i + 1))
        # Accounts for text after the last footnote which only runs once.
        newText.append(text[coordinates[i][1]:]+'\n')

endNotes = []
for j in range(0, len(footnotes)):
    insertList = ''.join(['\n','[^{}]: ', footnotes[j], '\n']).format(j + 1)
    endNotes.append(insertList)

newText = ''.join(newText) + '\n' + ''.join(endNotes)

newFile = open(file_path, 'w')
newFile.truncate()
newFile.write(newText)
newFile.close()
November 19, 2012

It is so tempting to try to apply cognitive science results in education. It seems like an obvious step on the long road of moving education from a field of theory and philosophies to one more grounded in empirical research. Yet, learning myths are persistent. Even scarier, “those who know the most about neuroscience also believe the most myths.

Educators may have the best intentions when trying to infuse their practice with evidence, but they all too often are not equipped as critical consumers of research. Worse, the education profession has historically been wrapped in “thoughtworld” 1, where schools of education have taught same ideas about effective teaching and learning for decades without a basis in empirical research. These same ideas are taught to principals, district administrators, and teachers, so nary a critical voice can stop the myths from being repeated and mutually reinforcing each other.

Effectively conducting empirical research, translating research for policymakers, and implementing research-based program design is my job. I came to education purely from a research and policy perspective, and I am equipped to understand some of the empirical research done on effective schooling 2.

I have to confront an awful history of “outsiders” like myself who have brought round after round of poorly supported, poorly evaluated reforms. I have to confront the history of districts and schools discarding some very effective programs because of leadership changes, lack of resources, and most of all a lack good, systematic evaluation of programs. And I have to be damn good at what I do, because even a small misstep could paint me just like every other “expert” that has rolled through with the newest great idea.

I think this is why I tend to favor interventions that are very small. Simple, small, hard to “mess up” interventions,  based in research, implemented just a few at a time have tremendous potential. I love the oft-cited work on filling out the FAFSA along with tax filing at H&R Block. It is simple. There is no fear of “dosage” or implementation fidelity. There are both sound theoretical reasons and empirical results from other domains that suggest a high likelihood of success. It has the potential to make a huge impact on students without adding any load to teachers who are, say, implementing a brand new and complicated curriculum this year. This is how you earn trust through building success.

I am also a fan of some really big, dramatic changes, but how I get there will have to be the subject of a future post.


  1. E.D. Hirsch’s term ↩︎

  2. In the area of neuroscience and cognitive science, I am probably only marginally better off than most teachers. My Sc.B. is in chemistry. So a background in empirical physical sciences and my knowledge of social science may help me to access some of the research on how people learn, but I would probably be just as susceptible to overconfidence in my ability to process this research and repeat untruths as many very intelligent educators. ↩︎

November 3, 2012

Apple has released the iPad Mini. Microsoft unveiled the Surface RT. Google has expanded its play with the Nexus 4 (phone) and 10 (tablet) to sandwich the previously released 7. In virtually every review of these new devices the Apple advantage was ecosystem.

Time and time again, following descriptions of well designed and built hardware 1, reviewers were forced to add some form of, “But the ecosystem cannot compete with Apple’s 275,000 tablet-optimized application.” I think this understates the power of Apple’s amazing developer advantage.

I use three distinct computing platforms every day: my phone, my tablet, and my traditional PC (laptop and desktop). There are times where I use an application which is specific to one platform or the other. Dark Sky, for example, is incredibly useful on my iPhone but would be pretty pointless on my Mac Mini or Macbook Air. This kind of platform-specific, quality application is what most would consider the App Store advantage. Not me.

Apple’s true advantage is when applications are available across all three platforms, offering simultaneously a device-optimized and consistent experience no matter what I am using.

They offer a frictionless experience.

There is a good reason people were so excited for Tweetbot for OSX and love to use Reeder on iPhone, iPad, and OSX. The features, feel, gestures, and even notification sounds having consistency across environments makes it easier to use computers. The so-called “halo effect” of the iPod was widely discussed in the early 2000s. iTunes on every Windows machine represented the tail end of a long play that pushed the promise of frictionless computing with Apple products. iOS delivers on this promise in spades.

Google knows a big selling point of Android is offering the best mobile experience with their web products. As an early and voracious user of Gmail, Google Contacts, and Google Calendar, I do find this enticing. But Android apps are never going to be able to offer the frictionless experience offered by Apple across the mobile and desktop space. ChromeOS is Google’s best effort to push a frictionless platform, but it’s entirely limited to non-native applications so anything but Google products require major modifications and just won’t be the same.

Microsoft sees the Apple advantage clearly, and they understand Google’s inability to fully compete. That’s why they are launching Windows 8, in many ways attempting to even further integrate the tablet and desktop than Apple. The Surface, and Windows 8 writ large, is a bet that Apple made a mistake grouping tablets with cell phones. The tablet, according to Microsoft, is about replacing laptops and should be grouped with the desktop.

I think this is a smart play, regardless of some of the rough reviews of both the Surface RT and Windows 8. Version 1 has some awkward transitions on both devices, but that may be worth the cost to take advantage of a near-future where the power available on a large tablet will be comparable to that of a laptop or even desktop computer. Just as the Macbook Air is every bit as good a consumer computer as “the fatter” laptop market, soon tablets will be every bit as good a consumer computer that exists. Microsoft’s bet is that with that power will come more sophisticated and complex uses, better suited to applications at home on the desktop. They are betting the future is the past– a full multitasking enabled, file-system revealing environment. If that’s what users will eventually want from their tablets, Windows 8 will have these capabilities baked in from the start while iOS struggles to pump out new features and APIs to mimic (or create) these capabilities.

The future is frictionless. Apple’s true advantage is they can already offer one version of that future. If Microsoft plays its cards right, and if it is not too late 2, they can offer an equally compelling alternative. It won’t win over the real, dyed-in-the-wool Apple fans, but it may stem the tide carrying the consumer market swiftly away.


  1. Hardly a given in the past from either Google (LG/ASUS) and Microsoft partners. Although Microsoft’s actual hardware, until now primarily keyboards and mice (do you pluralize a computer mouse? It seems strange.) ↩︎

  2. I really think it might be. Windows Phone 7 was brilliant, but released 2 years too late behind at least 1 year of development. ↩︎

November 1, 2012

I like this piece in Slate on Paul Cuffee Middle School, a charter school right here in Providence. Most of what I know about child development seems to suggest that middle schools are sort of ridiculous. At the moment children are looking for role models and close relationships with adults (and not just the kids around them), we decide that kids should have many teachers, teachers should have higher loads, and the kids stay consistent while the adults change constantly.

In many ways, the elementary school model works better for middle school students and vice versa.

Anyway, some research showing K-8 schools have a built-in advantage against the traditional middle school:

The Middle School Plunge Stuck in the Middle 1


  1. A more “popular” version on Education Next here↩︎

October 8, 2012

I have been meaning to write this post for the past couple of weeks. Like most other people, I am constantly experimenting with different ways to publish and share my thoughts and engage with social networking. Lately, I have settled into what feels like an “end state” workflow1. I will devote a future post to the details of how I manage my online reading, writing, and sharing workflow but for now I just wanted to let folks know where they can find me.

For random thoughts throughout the day I mostly turn to my Twitter account or increasingly my App.net account. I am a retweet abuser, so if you follow me there be warned. I often just retweet things I find funny or interesting, write some random complaint about coding, policy, or education when I’m frustrated and don’t understand the world, and try syndicate some of the other sources I’ll list here. I also like to talk to people on Twitter, so if you’re looking for conversation that’s the place to go. I almost use it like it’s the new IRC/AIM Chatroom. My Twitter account is a bit more Providence/Rhode Island heavy than most other ways to follow me.

Some of you may know that I also have a Tumblr that has fallen in and out of favor. I used to blog over there before creating this Wordpress site2. Recently, I have used my Tumblr account much more. Since Google Reader removed its social features I have tried to find the best way to share the best stuff I read each day with a few thoughts. I toyed with Google Plus, but it really is dead. I don’t find good content there and engagement with my sharing has been very low. Also, the lack of a write API makes it very challenging to incorporate in a non-disruptive way.3So right now, head over and follow my Tumblr (natively or RSS) if you want to get 5-10 link posts each day of things I’ve collected across the web. Some of my favorite online friends found me through my Google Reader sharing and I suspect that they would enjoy my Tumblr most of all. If I start getting more engagement around what type of links folks are enjoying I can begin to shift the topics I post on. I collect many more links than what end up in Tumblr in Google Reader and Pinboard. I have a very specific path to end up in Tumblr that leans more towards long reads and shares from friends and not what I am watching on RSS.

A few months ago I ditched my original Facebook account from 2005 and reopened a fresh one. I did this for two reasons: 1) I had collected many friends that I was not truly in contact with. Because of the layers and layers of privacy changes that Facebook went through, it became very difficult to maintain settings I was comfortable with. I wanted to start fresh with friends and fresh with how I manage privacy. 2) Related to 1, I never used Facebook as a networking tool. To me, it was always supposed to be a way to interact and keep in touch with friends from “real life”. Ultimately, I didn’t find that aspect of Facebook to be all that valuable. So I’m trying to be a believer and use Facebook more like I use other social media–  a way to tap into my “interest graph” and meet new people and read new things and have new conversations. You can follow me there with a few caveats. I hate using Facebook, so it is probably going to have the least content. There will still be some personal stuff as most of my friends still see Facebook as an intimate space, shocking though that may seem. Finally, I may not friend you back. Yes, the point of this account is to be more open, but Facebook still creeps me out and on any given day I may feel more or less incline to be open on there.

This blog will remain where I write longer pieces that are primarily “original” analysis/thoughts and less news/broadcast-like. I hope to share a lot more code and thoughts on current research in the near future now that I’m changing jobs.


  1. Subject to change, but I’m betting it’s more tweaks at this point than dramatic shifts ↩︎

  2. and I really want to leave Wordpress, but that is going to be a big project ↩︎

  3. Definitely more on this in my future workflow post ↩︎

September 30, 2012

I have not had the opportunity to read Paul Tough’s newest book on “grit”1. I have, however, read Paul Tough’s New York Times Magazine article on grit and recently listened to an EconTalk podcast where he discussed How Children Succeed.

The thrust of Tough’s argument, if I were to be so bold, is that there is a definable set of non-cognitive skills, called “grit”, that are at least as important as academic achievement in determining long-term positive outcomes for kids. Great schools, therefore, would do well to focus on developing these habits as much and as intentionally as they do developing content knowledge and academic prowess. This, according to Tough, is a big part of the “magic sauce”2of “No Excuses” schools like KIPP. They teach “grit” as a part of their intense behavioral management and culture efforts.

I think Tough is an engaging writer and has a great knack for finding some of the most interesting research not often read in education policy circles, but which is clearly relevant. While listening to the EconLog podcast I found myself often disagreeing with his interpretations/conclusions. But more often, I found myself desperately wishing for a different, slower format because so much of this work begged deeper questioning and conversation. What better reason could there be to buy and read a book-length treatment of these ideas?

Anyway, I thought I’d share just a few of my thoughts on “grit” based on this interview and the earlier New York Times Magazine piece.

Teaching conscientiousness in a society that has been so unconscientious

It seems fairly obvious that people who don’t “play by the rules” and aren’t easily motivated to conform to certain habits are less likely to be successful. It is unsurprising that Tough finds research that suggests that there is a “grit” gap between rich and poor. I want to know more about why, and I have, what I hope, is one interesting idea of what contributes to the “grit gap”.

I believe that deterioration of the built environment, especially among the urban and truly rural poor, is a major contributor to low grit. Some parts of this country with high concentrations of poverty look– bombed out. Roads are littered with deep potholes and scars. The houses have chipped paint, rotting wood exterior elements, and unkept yards. Storefronts were built decades ago on the cheap, aged poorly, and were never updated. Their schools lack good lighting, decent HVAC systems, and functioning toilets. There is no pride found in any of these spaces.

Children growing up in poverty do not see neighbors obsessing over their lawn. They do not watch one house after another repaint and reface their exteriors to ensure they weren’t the ugliest house on the block. They do not see brand new cars, fresh asphalt roads, and schools that resemble palaces. I don’t think virtually any of this has to do with the people who live in these neighborhoods. I do think it reflects the pathetic state that society has deemed acceptable, so long as it remains sight unseen by those with resources.

Growing up in poverty often means being surrounded by spaces that society has left to rot. How can these children learn conscientiousness when the privileged have been so unconscientious?

The M&M Study

Tough mentions a study where students first take an IQ test under normal conditions. These same students are then given an IQ test but are rewarded with an M&M each time they get a question right. This tiny immediate incentive resulted in a massive, 1.8SD improvement in mean IQ. 3 The implications are fascinating. It demonstrates the importance of motivation even while taking a test that is supposedly measuring an intractable, permanent attribute people have. This seems obvious and is fairly well known, but forgotten in many policy circles. I have often lamented that the New England Common Assessment Program has a sizable downward bias when measuring achievement because the exam is low stakes for students. The dramatic decrease in performance observed on the 11th grade NECAP math exam is almost certainly in part due to lower intrinsic motivation amongst high school students compared to their 8th grade and younger selves.

There are some students that have no measurable response to the M&M incentive. These students are exhibiting qualities of Tough’s “grit”, conscientiousness that leads one to do well simply because they are being measured, or perhaps because there is no reason to do something if it is not going to be done well. I believe that there is also a bias against schools with concentrated poverty because of an uneven distribution of “grit”– suburban middle to upper class students with college ambitions will likely be the students who will sit down and try hard on a test just because they are being measured whereas urban students living in poverty are far less likely to exert that same effort for an exercise with no immediate or clear long-term consequences.

All of this would be pretty blasé were it not for the more distal outcomes observed. The group of students that did not respond to the M&M incentives had significantly and practically better outcomes than those that responded to the incentive. I can’t recall exactly which outcomes were a part of this study, but Tough cites several independent studies that measure a similar set of qualities and find far better outcomes with GPA, graduation from high school, post-secondary degree attainment, juvenile delinquency or adult criminal activity, and wages.

Tough’s interpretation of these results seems to mirror my feelings on grading. Low stakes testing (or in this case, no-incentive testing) has omitted variable bias which leads to observing students who lack “grit” as lower achieving than they are. The test results are still excellent predictors of later success but lack validity as a pure measure of academic achievement. My complaint about grades that use behavior, attendance, and participation4does not stem from their lack of validity at predicting later outcomes. These grades are excellent predictors of later outcomes. Rather, it stems from these grade conflating two very different qualities into a single measure, making it far more difficult to design appropriate interventions and supports that target individual needs.

Tough seems thinks this means that high stakes placed on test scores over emphasizes one quality over the other when both are very important. I disagree. I feel that high stakes test scores recreate the M&M incentive and leads to a better measure of academic ability. That is not to say that we don’t need to cultivate and measure non-cognitive skills. It just means that trying to measure both at once5results in less clear and actionable interpretations.

Is the “grit” problem properly described as a failure to recognize long-term benefits?

Repeatedly both Tough and host Russ Roberts point to the need to provide students who lack grit more information on the long-term benefits of “doing well”. For example, Tough cites KIPP’s posting of the economic benefits of a bachelor’s degree on walls in the halls of their schools as a way to build grit. Somewhat left unsaid is the idea that grit-like behaviors may not describe some kind of “intrinsic” motivation, but instead represent an understanding of the long-term extrinsic benefits of certain actions. Grit really means understanding that, “If I behave appropriately, I will gain the respect of this authority and earn greater autonomy/responsibility,” or perhaps, “Doing my homework each night will teach me good habits of work and help me to learn this academic material so I can succeed in college and get a better job.”

Can grit really be just a heuristic developed to better respond to long-term incentives?

I am not sure. I am equally unsure that the activities of a “No Excuses” school actually generate the long-term benefits of “grit”. If grit is a powerful heuristic to optimize long-term outcomes, how do we know that many short-term incentives that build behaviors toward academic success mean that students better respond to a broad set of long-term outcomes? Should we believe that behavior bucks/demerit systems, constant small corrections, repeatedly stating the goals of education and its benefits, and other KIPP-like culture-building strategies build a bend toward acting in ways that maximize long-term outcomes? Do students aspire to college because they have internalized its importance, or do the stack of short-term incentives build a desire for sprokets, wignuts, and widgets that just happened to be called a “bachelor’s degree” in this case?


  1. I use “grit” a lot in this post. Please insert quotes each time. It got obnoxious reading it with the quotes actually in place ↩︎

  2. My term, not his. Probably stolen from one of my colleagues who uses this term a lot. ↩︎

  3. From 79 to 97 according to EconTalk ↩︎

  4. among other non-cognitive, non-academic skills and activities ↩︎

  5. Or inadvertently measuring both at once, as many low-stakes standardized tests do ↩︎

Philip Elmer-DeWitt has suggested the iOS6 Maps debacle falls on the shoulders of Scott Forstall1. When I first read the piece, I felt like it was unfair to blame management for this kind of failure. In my experience, the Maps application is wonderful software. The turn-by-turn directions are elegant and beautiful. The vector-based maps load fast and use substantially less data. The reality is the Map app is great; the data are less so.

Building great mapping data is no easy task. It takes years. It takes human intervention. It takes users. Short of a massive acquisition of an existing player, like Garmin, there was little hope of Apple developing a great map application for day one of release. Hell, in my experience, most stand alone GPS data is pretty awful in all the ways the Apple data is awful. That’s why I primarily used my iPhone as my GPS the last few years. The experience was consistently better and less frustrating. Perhaps even more critically, Apple is just not a data company. Google is the king of data. The skills required to build great geographic data simply doesn’t map well against previous Apple competencies. None of this means that the Apple Map situation is good or even “excusable”. I just think the map situation is “understandable” and would not be with different guidance.

But then I reevaluated and realized that there is a major way that management could have improved Apple Maps for iOS. Managers should set the bar for quality, make sure that bar is met, and adjust both resources and expectations when a project is not meeting user expectations. It must have been obvious to Apple management that the quality expectations were not going to be met.

What could Forstall have done? Some have suggested thrown substantially more money at the project. Others say he should have “winked” at Apple users and clearly signaled that Maps were in their infancy. And of course there were those who said he should have waited another year for the Google Maps contract to expire. John Gruber is rather convincing that simply waiting another year was not an option. Apple really couldn’t swap maps out of iOS in the middle of the OS cycle. It would be jarring and far more frustrating than the current situation.

I would have recommended a third option.

Apple should have released iOS6 Maps as US only.

@jdalrymple what if Apple execs realized it wasn’t going well & made maps US only & world in 6-12mo. Still had Google contract time for that

— Jason Becker (@jasonpbecker) September 29, 2012

One of the major themes of the iPhone 5 release was that this was a global phone. Global LTE, with day one launches in more countries and reaches far more countries, faster, than ever before after that. In fact, the Verizon CDMA iPhone comes with an unlocked GSM radio. But mapping is hard, and that problem becomes orders of magnitude more difficult with each inch of the planet that needs to be covered. When it became clear that Apple had a beautiful application, but awful data, Forstall and the rest of Apple management should have adjusted expectations and promised a US-only release that met the quality that consumers have come to expect. This would serve to increase resources, while winking at users, and utilizing the remainder of the Google contract for international mapping. With six additional months Apple could make great strides improving international data and possibly signing some additional, high-profile maps data deals with local sources/competitors that would love to be associated with Apple, even if it is just in a footnote. US users would rave about the great vector mapping, the turn by turn directions that are brilliantly integrated into the lock screen and always provide just enough information, and the cool integration into Open Table and Yelp. US maps would get better because they would have constant users. The rest of the world would lap up iPhone 5s and wait anxiously for their chance to taste the Great Apple Maps.

In this scenario, it is possible that Apple could have had the best of both worlds: a far worse data set in an application that cost just as much, but by limiting the scope to their key market, a reputation for excellence that would lead to excitement for the end of a competitor’s product.

I am sure there were other challenges with producing a US-only2that I am not considering. I think this is at least one typical techniques in IT management that Apple could have employed for a smoother, better release of their first efforts into a complicated and competitive space.


  1. Of iOS skeumorphism fame↩︎

  2. Or North America only. There are barely any roads in Canada, right? ↩︎

September 18, 2012

Bruno is a skeptic on standards-based grading. He seems to think that “mastery of content” is too abstract for students to work toward and rightly cites evidence that motivation and changed behavior are tightly linked to a sense of efficacy, which in turn is tightly linked to feeling as though you know precisely what to do to get to a particular outcome.

But isn’t mastery of content essentially, “Do well on your assignments and tests”? And while a massive, standards-based report card may be hard for a parent to read, is it any more confusing than seeing awful results on standardized tests and a student who clearly doesn’t read on grade-level receive good grades because of participation, attendance, and behavior? As a parent, how do you know to intercede on your child’s behalf when you see a “B” which actually represents a C- on content knowledge and skills and an A+ for effort, behavior, and completion?

Ultimately, I am against including behavior, attendance, and effort as a part of the same grade as academics. I think there needs to be a clear place to present evidence of academic ability and growth independent of behavioral growth. Both are important, and while linked, are certainly not moving in lockstep for the typical child. Accurate information in both domains is far better than falsely presenting a singular, mixed-up “truth” about a child’s success in school.

For the same reason I am not a fan of school report cards with a single letter grade rating, I am not for just a single letter grade for students. Ultimately, they both represent poor combinations of data that obscure more than they reveal.

Developing report cards or “grading” systems, both for program evaluation and for students, always conjures one of the few concepts I recall from linear algebra. It seems to me that any good grading system should provide a basis, that is, a minimal set of linearly independent vectors which, via linear combination, can describe an entire vector space. Remove the jargon and you’re left with:

Measure the least amount of unrelated things possible that, taken together, describe all there is to know about what you are measuring.

A single grade that combines all the effort, behavior, attendance, and various unrelated academic standards I might get an overall description that says “round”. But by separating out the data at some other level, the picture might describe a golf ball and its dimples, a baseball and its stitches, or a soccer ball with its hexagon-pentagon pattern.

I think we need to find a way to let people know what kind of ball they have.

August 21, 2012

So I have this great little custom function I’ve used when looking at survey data in R. I call this function pull(). The goal of pull() is to quickly produce frequency tables with n sizes from individual-level survey data.

Before using pull(), I create a big table that includes information about the survey questions I want to pull. The data are structured like this:

quest survey year break
ss01985 elementary 2011\_12 schoolcode

  • quest represents the question coding in the raw survey data.
  • survey is the name of the survey (in my case, the elementary school students, middle school students, high school students, parents, teachers, or administrators).
  • year is the year that the survey data are collected.
  • break is the ID I want to aggregate on like schoolcode or districtcode.

They key is that paste(survey, year,sep='') produces the name of the data.frame where I store the relevant survey data. Both quest and break are columns in the survey data.frame. Using a data.frame with this data allows me to apply through the rows and produce the table for all the relevant questions at once. pull() does the work of taking one row of this data.frame and producing the output that I’m looking for. I also use pull() one row at a time to save a data.frame that contains these data and do other things (like the visualizations in this post).

In some sense, pull() is really just a fancy version of prop.table that takes in passed paramaters and adds an “n” to each row and adding a “total” row. I feel as though there must be an implementation of an equivalent function in a popular package (or maybe even base) that I should be using rather than this technique. It would probably be more maintainable and easier for collaborators to work with this more common implementation, but I have no idea where to find it. So, please feel free to use the code below, but I’m actually hoping that someone will chime in and tell me I’ve wasted my time and I should just be using some function foo::bar.

P.S. This post is a great example of why I really need to change this blog to Markdown/R-flavored Markdown. All those inline references to functions, variables, or code should really be formatted in-line which the syntax highlighter plug-in used on this blog does not support. I’m nervous that using WP-Markdown plugin will botch formatting on older posts, so I may just need to setup a workflow where I pump out HTML from the Markdown and upload the posts from there. If anyone has experience with Markdown + Wordpress, advice is appreciated.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
pull <- function(rows){
  # Takes in a vector with all the information required to create crosstab with
  # percentages for a specific question for all schools.
  # Args:
  #  rows: Consists of a vector with four objects.
  #        quest: the question code from SurveyWorks
  #        level: the "level" of the survey, i.e.: elem, midd, high, teac, admn,
  #        pare, etc.
  #        year: the year the survey was administered, i.e. 2011_12
  #        sch_lea: the "break" indicator, i.e. schoolcode, districtcode, etc.
  # Returns:
  # A data.frame with a row for each "break", i.e. school, attributes for
  # each possible answer to quest, i.e. Agree and Disagree, and N size for each
  # break based on how many people responded to that question, not the survey as
  # a whole, i.e. 

  # Break each component of the vector rows into separate single-element vectors
  # for convenience and clarity.
  quest <- as.character(rows[1])
  survey <- as.character(rows[2])
  year  <- as.character(rows[3])
  break <- as.character(rows[4])
  data <- get(paste(level,year,sep=''))
  # Data is an alias for the data.frame described by level and year.
  # This alias reduces the number of "get" calls to speed up code and increase
  # clarity.
  results <- with(data,
                  dcast(data.frame(prop.table(table(data[[break]],
                                                    data[[quest]]),
                                              1))
                        ,Var1~Var2,value.var='Freq'))
  # Produces a table with the proportions for each response in wide format.
  n <- data.frame(Var1=rle(sort(
    subset(data, 
           is.na(data[[quest]])==F & is.na(data[[break]])==F)[[break]]))$values,
                  n=rle(sort(
                    subset(data,
                           is.na(data[[quest]])==F &
                             is.na(data[[break]])==F)[[break]]))$lengths)
  # Generates a data frame with each break element and the "length" of that break
  # element. rle counts the occurrences of a value in a vector in order. So first
  # you sort the vector so all common break values are adjacent then you use rle
  # to count their uninterupted appearance. The result is an rle object with 
  # two components: [[values]] which represent the values in the original, sorted
  # vector and [[length]] which is the count of their uninterupted repeated
  # appearance in that vector.
  results <- merge(results, n, by='Var1')
  # Combines N values with the results table.

  state <- data.frame(t(c(Var1='Rhode Island', 
                          prop.table(table(data[[quest]])),
                          n=dim(subset(data,is.na(data[[quest]])==F))[1])))
  names(state) <- names(results)
  for(i in 2:dim(state)[2]){
    state[,i] <- as.numeric(as.character(state[,i]))
  }
  # Because the state data.frame has only one row, R coerces to type factor.
  # If I rbind() a factor to a numeric attribute, R will coerce them both to
  # characters and refuses to convert back to type numeric.
  results <- rbind(results, state)
  results
}   
August 5, 2012

I like paying for good software. There are applications I use every day, some for hours a day, that make my experience on the web and on my computers better. I have paid for Reeder on three platforms, Tweetbot on two1, Pinboard, and many others. I like to pay, because I value my time, my experience, and my productivity.

I also like to pay because I value my privacy.

Don’t get me wrong– I am a Google addict, using Gmail practically from the beginning, GChat, Google Calendar, Google+, Google Reader, etc, etc. I have a Facebook account (although I recently removed my original account from 2005). I spent quite a bit of time on Twitter. These are g are reat places to do great work and to have a lot of fun. They are key parts of my professional and personal life. All of these services, however, built around the model of selling me. They offer a real modern day example of TANSTAAFL. Nothing leaves my pocket, but massive hoards of data are used to direct advertising my way and some of that data is even sold to other companies. Knowing your customers has always been valuable, and the price of “free” is my very identity.

Now, generally I think that these major companies are good stewards of my privacy. As a budding data professional, I know just how difficult and meaningless it would be for any of these companies to truly target me rather than learn about a cloud of millions people moving at once. I also believe they realize how much of their business model requires trust. Without trust, giving up our privacy will feel like an increasingly large ask.

I value my privacy, but I value good software as well. Right now, I have not found alternatives for many “free” services that are good enough to make up for the cost of my privacy. I am a willing participant in selling my privacy, because I feel I get more value back than I am losing.

But, privacy is not the only reason I wish there were alternative services and software I could buy.

I was probably pretty sloppy in this post interchanging “software” and “services”. Many of the websites or software I mentioned are merely front ends for a more valuable service. Gmail is not the same thing as email. Reeder is actually a software alternative (and more) to Google Reader’s web-based front end for a news aggregator. GChat is just a Jabber/XMPP client. Ultimately, much of what I do around the internet is about moving structured data around between peers and producer-consumer relationships. All of the great things that made the web possible were protocols like HTTP, TCP/IP, etc. And the protocols of todays web are the standardized APIs that allow programmers a way to interact with data. Great, innovative software for the web is being built that ultimately change the way we see and edit data on these services. The common analogy here is that of a utility. The API helps users tap into vast networks of pipes and interact with the flow of information in new, exciting ways.

To get a sense of how amazing new things can be done with an API look no further than IFTTT. It is like a masterful switching station for some of the most useful APIs on the web. Using Recipes on IFTTT, I can do something amazing like this:

  1. Find a really cool link from a friend on Twitter.
  2. Save that link to Pinboard, a great bookmarking site, with tags and a description so that I can find it later easily.
  3. Add tags to the Pinboard bookmark for the social sites I want to share on, e.g. to:twitter to:facebook to:linkedin to:tumblr, all of which are special tags that I use with the IFTTT API.
  4. IFTTT, which is linked to my Pinboard account, looks occasionally to see any recently saved links. It finds a new link with those special tags (called Triggers).
  5. Each of those special tags tells IFTTT to make a new post on a different social networking site sharing my link (sometimes with tags, sometimes with the description, sometimes with nothing, all of which I set up) seamlessly without any user interaction.
  6. My cool link gets sent strategically where I want it to be sent without every leaving the site. I just clicked one button and added the right tags.

This kind of interaction model is impossible without agreed upon standards for sites to read and write information to one another.

The open API which made it so easy to innovate quickly from the outside– Facebook’s Platform, the Twitter API, etc– is under a serious existential threat. The truth is, these darlings of Web 2.0 don’t have a great idea about how to make money. The free web has almost entirely depended on advertising revenues to turn a profit. But how can these companies make money if I’m not using their webpage or their website to get access to my data?

Do you see the part that I slipped in there? These companies have lost site of one very important part of the equation– the content was free because the users created it. Its our data.

Twitter seems to be on the verge of removing or limiting critical portions of the their API at the expense of many developers building new ways to interact with Twitter data, and, more importantly, all of their users who have joined Twitter because it was a powerful platform, not just a fun interactive website. Their tumultuous corporate culture has landed here because they decided that the promise of big revenues for their investors is not enhanced by people accessing Twitter through unofficial channels. Facebook has made similar moves in light of its short, but disastrous history as a public company.

If things shake out the way they seem to be, the sexy startups of Web 2.0 will turn away from the openness conducive to gaining users as they mature. These sites will consolidate and limit the experience, pushing for more page views and time on their site by making it hard to leave. They are rebuilding America Online2, trying to make it so that their webpage becomes synonymous with “the Internet” for their users. Want your ads to be worth more money? Make it hard to change the channel.

It is for this reason that I am supporting App.net. The commitment is a little steep, until you consider how valuable these services have become. For the cost of one pretty nice meal out with my girlfriend, I am purchasing one of the best ways to communicate on the web. I am supporting a model for good software that means that user experience and needs are paramount. I am purchasing customer service because I am sick of ad companies being the customer while I am stuck as the product. I am paying for access so that there is a large competitive market vying for the best way for me to interact with my data. I am paying because I am ready, no desperate, for great consumer software and services that live and breathe to optimize my experience. I used to trust the free web for this, but their business model and their success means they don’t need me as much as they need their advertisers anymore.

Please join me in supporting App.net. Even better, please join me in finding ways to buy great software to support the products make our lives more fun and our work more efficient and productive3.

This is the path to a successful Web 3.0.


  1. almost certainly three when they are out of alpha with their OSX application ↩︎

  2. Facebook, especially in my opinion ↩︎

  3. and please choose and support FOSS solutions with your time, labor, and/or money ↩︎

July 11, 2012

Ted Nesi was gracious in offering me a guest spot on his blog, Nesi’s Notes this week to discuss education funding in Woonsocket. The main conclusions of my post are:

​1. Woonsocket has not increased local funding for education over the last fifteen years despite massive increases in education expenditures in Rhode Island and nationwide.

​2. General education aid from the state has rapidly increased over the same period, demonstrating that a lack of sufficient revenue at Woonsocket Public Schools is first, if not exclusively, a local revenue problem.

I wanted to provide three additional bits of information on my personal blog.

First, I want to outline some analyses that I have not done that I think are critical to understanding education funding in Woonsocket. I will also describe more completely what conclusions cannot be drawn from the analysis on Nesi’s Notes.

Second, I want to discuss the legal context of school funding in Rhode Island. This is especially interesting since Pawtucket and Woonsocket are both currently suing the state for additional funds for the second time. I am going to review what happened the first time these communities brought their fight for education aid to the courthouse and explain why I believe this strategy will fail once again.

Third, I want to provide instructions on precisely how I retrieved the data and created the graphs in that post. I am a firm believer in “reproducible research”, so I want to be entirely transparent on my data sources and methods. I also think that too few people are acquainted with the Common Core Data provided by the National Center for Education Statistics that I relied on exclusively for my guest blog. Hopefully these instructions will help more concerned citizens and journalists in Rhode Island use data to back up assertions about local education.

Please reserve your comments on my original posts for Nesi’s Notes. I have disabled comments on this post, because I would like to keep the comments on the original analysis contained in one place. Feel free to comment on each of the follow up posts.

My last post ended with an important question, “Who is responsible for ensuring students are receiving a certain minimum quality education?”

This is my attempt at answering that question.

Does the state have a legal obligation to fiscally ensure that Woonsocket students are receiving an equitable, adequate, and meaningful education? San Antonio v. Rodriquez, a landmark Supreme Court case decided in 1973 determined that there was no fundamental right to education guaranteed by the U.S. Constitution. Since that decision, advocates for fairer education funding have focused their efforts in state courts arguing over provisions in state constitutions that include some rights to education.

In Rhode Island, the City of Pawtucket v. Sundlun in 1995 tested Article XII of the state constitution which stated “it shall be the duty of the general assembly to promote public schools…”. In this case, East Greenwich, Pawtucket, and Woonsocket sued the state claiming that the duty to promote public schools amounted to a guarantee of equitable, adequate education funding from the state, a burden not met by the current General Assembly education aid distribution.

I am not a legal expert, but I find the conclusions of the Supreme Court abundantly clear. In Pawtucket, the court decides to overturn a Superior Court decision which had earlier ruled that the state constitution guaranteed each child, “receive an equal, adequate, and meaningful education.” Pawtucket finds that the General Assembly’s responsibility to “promote” as “it sees fit” (emphasis added in the original decision) is quite narrow; the General Assembly clearly has the power to determine how to “promote” education, it has historically used that power in a way that relied on local appropriations to education, and the courts do not even have a judicable standard1to determine the General Assembly has failed to “promote” education.

The current lawsuit asserts two things have dramatically changed since Pawtucket that justify a second look and new ruling2. First, one portion of the state constitution has recently been changed that was used in the prior ruling. The Supreme Court’s decision stated:

Moreover, in no measure did the 1986 Constitution alter the plenary and exclusive powers of the General Assembly. In fact, the 1986 Constitution provided that:

“The general assembly shall continue to exercise the powers it has heretofore exercised, unless prohibited in this Constitution.” Art. 6, sec. 10.

Essentially, the judge stated that this section of the state constitution meant that the legislature was retaining the right to exercise its powers as it had historically. In the case of education, this means “the power to promote public education through a statutory funding scheme and through reliance on local property taxation,” in accordance with the findings in the decision. However, Article 6, section 10 of the state constitution has subsequently been repealed. It is worth repeating what I said previously, I am not a legal expert. However, I find the argument to overturn Pawtucket on the basis that the General Assembly is no longer expressly continuing to exercise their power as previously to be weak. My understanding of the Pawtucket ruling is that the court had only strengthened importance of historical context in making this decision by leaning on this constitutional provision. The importance of historical context still remains, even without this provision. In the Pawtucket decision, the “exercise of powers it has heretofore exercised” is interpreted to mean that unchanged constitutional language reflects unchanged powers. By maintaining the same language in 1986, despite amendments offered that would have more explicitly established a right to education, the General Assembly was, in effect, affirming its intent to continue to promote education as it had in the past. The plaintiffs in the current case, presumably, will argue that without Article 6, section 10, the General Assembly is allowing the courts to reinterpret even the same language to imply a different set of rights and responsibilities than it has historically. I have to ask, if the General Assembly’s intent was to signal that Article XII should now be interpreted as establishing a right to education, why wouldn’t they have adopted new, clearer language as was proposed in 1986? Having full awareness of the decision in Pawtucket, it is hard to see that the General Assembly would signal a change in its power and responsibility to promote education through a repeal of Article 6, section 10. I would assert this change simply shifts some of the burden to the finding that the General Assembly sees fit the promot[ion] of some judicable standard right to education that is the state’s fiscal responsibility.

This is the critical piece that the plaintiffs will not find. Nowhere has the General Assembly exercised its power to *promote *in this way. In fact, one only has to look at how the General Assembly has acted to establish a judicable right to education to observe precisely how it sees fit. Rhode Island General Law 16-7-24, titled “Minimum appropriation by a community for approved school expenses,” is a provision that all school committees are quite familiar with. Here, the General Assembly do establish a judicable standard for education, set by the Board of Regents of Elementary and Secondary Education in regulations known as the “basic education program”. But where Pawtucket fails to establish a constitutional guarantee for state funding in a particular amount for education, Rhode Island statute is quite clear on a minimum standard for local support. The law states that “Each community shall appropriate or otherwise make available… an amount, which together with state education and federal aid… shall be not less than the costs of the basic program… The Board of Regents for Elementary and Secondary Education shall adopt regulations for determining the basic education program…” In other words, Rhode Island statute squarely places the burden for meeting the Basic Education Program on cities and towns raising the required revenue. “A community that has a local appropriation insufficient to fund the basic education program … shall be required to increase its local appropriation…”

It seems pretty clear to me. While the plaintiffs in the current case will presumably argue that state regulations and laws do represent a judicable standard, they will be unable to find where the General Assembly, through action, has affirmed that it is the role of the state aid to meet this standard. Instead, the law directly states that local appropriations are to be increased if the Basic Education Program cannot be met. I cannot imagine that the Supreme Court would exercise its power to assert that the General Assembly’s inaction implies more about the purpose of unchanged constitutional language than the General Assembly’s actions.

In summary, although the city is again suing the state for additional education aid, it is clear in the last 15 years that the state has substantially increased its support for Woonsocket Schools3. Furthermore, previous Rhode Island Supreme Court decisions and Rhode Island law clearly places the burden of adequate school funding squarely on the shoulders of cities and towns, not the General Assembly. In my view, the changes in education law and policy since Pawtucket do not imply a change that would impact the court’s ruling.

This post is the second post of a three-part follow up on my guest post for Nesi’s Notes. Parts I and III can be found here.


  1. meaning measurable and enforceable by court room activities ↩︎

  2. Note: I have not read the complaint as I probably should have for this post. I ran out of time. However, I feel fairly certain from press coverage that I am correctly stating their main points ↩︎

  3. See my post on Nesi’s Notes ↩︎

There are several questions that come to mind when looking over my analysis on Nesi’s Notes. The first thing I wondered was whether or not Woonsocket had raised local revenues by similar amounts to other communities but had chosen to spend this money on other municipal services. Ideally, I would use a chart that showed local education revenues compared to all other local revenues over the last 15 years by city in Rhode Island. Unfortunately, Municipal Finance does not separate local, state, and federal revenue sources in the Municipal Budget Survey so it is hard to knowhow communities have funded different services. I am sure with a bit of finagling, I could come up with a fairly good guess as to whether or not Woonsocket has simply chosen to fund other municipal services with its taxes, but quite frankly it is not precise enough to make me feel like its worth the exercise of extracting data from PDF tables. I hope someone else will take up some form of this analysis, possibly by requesting the breakdowns from Municipal Finance.

Another consideration is whether there is any truth to Woonsocket’s claims that it simply does not have the ability to generate enough local revenue for their schools. I am skeptical on this claim. Three pieces of evidence suggest to me that this may not be true.

  1. The magnitude of the shortfall between the rest of the state and Woonsocket over the last 15 years when it comes to local education revenue. On its face, I don’t find it credible that Woonsocket’s tax base is so weak that it could not increase local revenues for schools even at the rate of inflation. Not increasing local revenue for schools seems to leave only two possibilities: 1) local revenues in general were not increased, meaning Woonsocket would have to argue that its taxation in FY95 was so high relative to everyone else that it took nearly 15 years for the rest of the state to catch up, hence no additional revenues; or 2) Woonsocket did raise local revenues, and chose to spend the money elsewhere. Had Woonsocket’s local education aid risen 65-75% versus a state average of around 100%, I probably would not have even written my post on Nesi’s Notes.
  2. Andrew Morse‘s analysis presented on Anchor Rising.1 Woonsocket appears to be on the low to typical end of revenues as a proportion of non-poverty income. It does not seem that they are anywhere near the “most” taxed city or town by this measure. I am not an expert on tax policy, but this measure seems fairly straightforward, fair, and informative.
  3. The mammoth proportions of Woonsocket’s budget being spent on pensions (through debt service) and other post-employment benefits. A full 15% or so of Woonsocket’s local revenues are being spent in these areas. This suggests to me misappropriation and poor planning has led to the erosion of local support for schools, not a lack of revenue generating capacity. If this truly is the case, then Woonsocket residents are really in trouble. Their leaders have managed to generate all of the high costs and high taxes experienced in Rhode Island without providing the quality of service that should be expected given those investments.

Of course, I failed to offer any recommendation for remedy in the Nesi’s Note post. How should Woonsocket schools become “whole” again? How can this possibly be accomplished in the context of a city on the brink of financial failure? Who has the legal responsibility to ensure that Woonsocket’s children get the education they deserve? I have no answers on the first two points. However, in the next section of this post I hope answer the last question, which is also the subject of a law suit filed by Pawtucket and Woonsocket against the state of Rhode Island.

Who is responsible for ensuring students are receiving a certain minimum quality education?

This post is the first of a three-part follow up on my guest post for Nesi’s Notes. Parts II and III can be found here.


  1. Andrew has been writing quite a bit about Woonsocket. For his most recent post, Andrew demonstrates Woonsocket has the fourth lowest revenues from residential taxes as a proportion of community wealth. A few things I’d like to point out on that post. First, I think Andrew was right to adjust for poverty in previous posts in a way he was unable to due to the structure of the new data. I support progressive taxation, so I don’t believe that it is fair to say that we should expect the same percentage of income tax from poorer communities that we do from wealthier ones. I also think that commercial taxes are very important revenue sources. I don’t think they should be universally dismissed when used as a substitute from residential revenues. There are times where marginally the greatest benefit can be had by lowering residents’ taxes. However, I do think that commercial tax should not be used as a substitute when there isn’t enough revenue in the pie. In Woonsocket’s case, it seems pretty clear they needed both the residential and commercial taxes to have sufficient revenues. ↩︎

My analysis on Nesi’s Notes depended entirely on the National Center for Education Statistics’ Common Core Data. The per pupil amounts reported to NCES may look a bit different from state sources of this information. There are several explanations of this. First, the enrollment counts used to generate per pupil amounts are based on an October 1st headcount. In Rhode Island, we use something called “average daily membership” (ADM) as the denominator and not a headcount. The ADM of a district is calculated by taking all the students who attended the district at any point in the year and adding up the number of school days they were enrolled for. The total membership (i.e. all the student*days, for those who like to think about this in units) is divided by the number of school days per year, almost always 180 (so student*days / days/year = students/year). Additionally, NCES does not record the final three digits on most financial data. These rounding issues will also make the per pupil data seem different from state reports.

I wanted to use the NCES to make sure that the data in my post was easily reproducible by any member of the public. I also thought using NCES would serve as a great learning opportunity for the wonks and nerds out there who never even realized how much rich data about schools and school finance are available through the federal government. That being said, I do believe that the state reported numbers are far more accurate than those available from the federal government. That is not to say that the federal data is bad. On the contrary, that data is substantially vetted and validated and is very useful for research. My concern was only that some of the tiny differences in the NCES data that deviated from what I would consider to be ideal data might reach the level where they affected the validity of the conclusions I wanted to draw.

Although I was writing as a private citizen without the support of the Rhode Island Department of Education, I did use my access to RIDE data to ensure that differences in the federal reports were not significant enough to call into question my analysis. I found that both the direction and magnitude of all the trends that I describe in the Nesi’s Notes post held up with the state data. While all of that information is publicly available, it is less easily accessible than NCES data and doesn’t provide the same opportunity for analysis outside of financial data. For these reasons, I decided to stick with NCES.

So how do you reproduce the data I used?

First, go to  the NCES Common Core Data Build a Table site. On the drop down, select “District” as the row variable and select the last fifteen years excluding 2009-10 (since there is no current financial data available for that year).

1

After clicking next, hit “I Agree” on the pop-up.

2

Now select “Finance Per Pupil Ratios” for the first column.

3

Click the green arrow that selects all years for local sources per student and state sources per student.

4

Click “Next>>” on the top right. Now select only RI-Rhode Island for your row variable.

5

Finally, click view table to see the results. I recommend downloading the Test (.csv) file to work with.

6

And finally, here’s the R code to reshape/rejigger the data I used and produce the graphics from the Nesi’s Notes post.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
## Using NCES data to analyze education finances to Woonsocket over 15 years.
## Initialize required packages
require(plyr)
require(reshape2)
require(ggplot2)
require(scales)
## Best to ignore this function-- it's mostly magic to me too. Essentially,
## multiplot takes in a bunch of plots and then puts them into one image
## arranging them by columns equal to a paramter cols. Credit to:
## [wiki.stdout.org/rcookbook...](http://wiki.stdout.org/rcookbook/Graphs/Multiple%20graphs%20on%20one%20page%20()    ggplot2)/
multiplot <- function(..., plotlist=NULL, cols) {
  require(grid)
  # Make a list from the ... arguments and plotlist
  plots <- c(list(...), plotlist)
  numPlots = length(plots)
  # Make the panel
  plotCols = cols                          # Number of columns of plots
  plotRows = ceiling(numPlots/plotCols) # Number of rows needed, calculated from #    of cols
  # Set up the page
  grid.newpage()
  pushViewport(viewport(layout = grid.layout(plotRows, plotCols)))
  vplayout <- function(x, y)
    viewport(layout.pos.row = x, layout.pos.col = y)
  # Make each plot, in the correct location
  for (i in 1:numPlots) {
    curRow = ceiling(i/plotCols)
    curCol = (i-1) %% plotCols + 1
    print(plots[[i]], vp = vplayout(curRow, curCol ))
  }
}
## Load data from the modified CSV. I made the following changes from the NCES
## downloaded file: 1) I removed all of the description header so that row one
## of the CSV is the attribute names; 2) I pasted the transposed state values
## to the final observation so that I have a state observation row analogous to
## the other LEA rows.

raw_data <- read.csv('rawdata.csv')
## Change name of first column to make things easier for later.
names(raw_data)[1] <- c('distname')
## Creating Time Series Data for each community of interest.
## I'm going to use a custom function to automate the steps required to create
## district level data in a time series.

create_ts <- function(name){
  # First create a column vector with the local funding
  # A few things to note: First, t() is the transpose function and helps to
  # make my "wide" data (lots of columns) "long" (lots of rows). Second, R
  # has a funny behavior that is very covenient for data anaylsts. It performs
  # many common mathematical operations element-wise, so the simple division
  # of two vectors below actually divides element by element through the
  # vector, e.g. column 17 is divided by column 2 to provide the first element
  # in the resulting vector. This makes calculating per pupil amounts very
  # convenient.
  local <- t(subset(raw_data,distname==name)[,c(17:31)]/
             subset(raw_data,distname==name)[,c(2:16)])
  # Performing the same operation for state per pupil amounts.
  state <- t(subset(raw_data,distname==name)[,c(32:46)]/
             subset(raw_data,distname==name)[,c(2:16)])
  # Putting state and local data together and getting rid of the nasty
  # attribute names from NCES by just naming the rows with a sequence
  # of integers.
  results <- data.frame(local,state,row.names=seq(1,15,1))
  # Naming my two attributes
  names(results) <- c('local','state')
  # Generating the year attribute
  results[['year']] <- seq(1995, 2009, 1)
  # This command is a bit funky, but basically it makes my data as long as
  # possible so that each line has an ID (year in this case) and one value
  # (the dollars in this case). I also have a label that describes that value,
  # which is local or state.
  results <- melt(results, id.vars='year')
  # Returning my "results" object
  results
}

## Create the Woonsocket data-- note that R is case sensitive so I must use all
## capitals to match the NCES convention.
woonsocket <- create_ts('WOONSOCKET')
pawtucket <- create_ts('PAWTUCKET')
providence <- create_ts('PROVIDENCE')
westwarwick <- create_ts('WEST WARWICK')
state <- create_ts('STATE')

## Developing a plot of JUST local revenues for the selected communities
## First I create a percentage change data frame. I think that looking at
## percent change overtime is generally more fair. While the nominal dollar
## changes are revealing, my analysis is drawing attention to the trend rather
## than the initial values.

## First, I pull out just the local dollars.
perwoonlocal <- subset(woonsocket,variable=='local')
## Now I modify the value to be divided by the starting value - 100%
perwoonlocal[['value']] <- with(perwoonlocal, (value/value[1])-1)
## A little renaming for the combining step later
names(perwoonlocal) <-c('year','disname','value')
perwoonlocal[['disname']]<-'Woonsocket'

## I repeat this procedure for all the districts of interest.
perpawlocal <- subset(pawtucket,variable=='local')
perpawlocal[['value']] <- with(perpawlocal, (value/value[1])-1)
names(perpawlocal) <-c('year','disname','value')
awlocal[['disname']]<-'Pawtucket'

perprolocal <- subset(providence,variable=='local')
perprolocal[['value']] <- with(perprolocal, (value/value[1])-1)
names(perprolocal) <-c('year','disname','value')
perprolocal[['disname']]<-'Providence'

perwwlocal <- subset(westwarwick, variable=='local')
perwwlocal[['value']] <- with(perwwlocal, (value/value[1])-1)
names(perwwlocal) <-c('year','disname','value')
perwwlocal[['disname']]<-'West Warwick'

perrilocal <- subset(state,variable=='local')
perrilocal[['value']] <- with(perrilocal, (value/value[1])-1)
names(perrilocal) <-c('year','disname','value')
perrilocal[['disname']]<-'State Average'

## The same process can be used for state data
perwoonstate <- subset(woonsocket,variable=='state')
## Now I modify the value to be divided by the starting value - 100%
perwoonstate[['value']] <- with(perwoonstate, (value/value[1])-1)
## A little renaming for the combining step later
names(perwoonstate) <-c('year','disname','value')
perwoonstate[['disname']]<-'Woonsocket'

## I repeat this procedure for all the districts of interest.
perpawstate <- subset(pawtucket,variable=='state')
perpawstate[['value']] <- with(perpawstate, (value/value[1])-1)
names(perpawstate) <-c('year','disname','value')
perpawstate[['disname']]<-'Pawtucket'

perprostate <- subset(providence,variable=='state')
perprostate[['value']] <- with(perprostate, (value/value[1])-1)
names(perprostate) <-c('year','disname','value')
perprostate[['disname']]<-'Providence'

perwwstate <- subset(westwarwick, variable=='state')
perwwstate[['value']] <- with(perwwstate, (value/value[1])-1)
names(perwwstate) <-c('year','disname','value')
perwwstate[['disname']]<-'West Warwick'

perristate <- subset(state,variable=='state')
perristate[['value']] <- with(perristate, (value/value[1])-1)
names(perristate) <-c('year','disname','value')
perristate[['disname']]<-'State Average'

## Pull together the data sets for the overall picture.
localfunding <- rbind(perwoonlocal, perpawlocal,perprolocal,perwwlocal,perrilocal)
statefunding <- rbind(perwoonstate, perpawstate,perprostate,perwwstate,perristate)

## A little ggplot2 line plot magic...
localperplot <- ggplot(localfunding,aes(year, value, color=disname)) +
                geom_line() +
                geom_text(data=subset(localfunding, year==2009),
                          mapping=aes(year,value,
                                      label=paste(100*round(value,3),'%',sep='')),
                          vjust=-.4) +
                scale_y_continuous('Percent Change from FY1995',
                                   label=percent) +
                scale_x_continuous('Year') +
                opts(title='Percent Change in Local Per Pupil Revenue, FY1995-    FY2009') +
                opts(plot.title=theme_text(size=16,face='bold')) +
                opts(legend.title=theme_blank()) +
                opts(legend.position=c(.08,.82))
stateperplot <- ggplot(statefunding,aes(year, value, color=disname)) +
                geom_line() +
                geom_text(data=subset(statefunding, year==2008 | year==2009),
                          mapping=aes(year,value,
                          label=paste(100*round(value,3),'%',sep='')),
                          vjust=-.4) +
                scale_y_continuous('Percent Change from FY1995',
                                   label=percent) +
                scale_x_continuous('Year') +
                opts(title='Percent Change in State Per Pupil Revenue, FY1995-    FY2009') +
                opts(plot.title=theme_text(size=16,face='bold')) +
                opts(legend.title=theme_blank()) +
                opts(legend.position=c(.08,.82))
ggsave('localperplot.png',localperplot,width=10,height=8,units='in',dpi=72)
ggsave('stateperplot.png',stateperplot,width=10,height=8,units='in',dpi=72)
    
## Proportion of Aid
proportion <- function(data){
  # This reshapes the data so that there is a year, local, and state column.
  # The mean function has no purpose, because this data is unique by year
  # variable combinations.
  prop <- dcast(data,year~variable,mean)
  # Adding local and state get our total non-federal dollars
  prop[['total']] <- apply(prop[,2:3],1,sum)
  prop[['perlocal']] <- with(prop, local/total)
  prop
}


## Prepare new data frames for proportion graphs

propwoon <- as.data.frame(c(disname='Woonsocket',
                            proportion(woonsocket)))
proppaw <- as.data.frame(c(disname='Pawtucket',
                           proportion(pawtucket)))
propprov <- as.data.frame(c(disname='Providence',
                            proportion(providence)))
propww <- as.data.frame(c(disname='West Warwick',
                          proportion(westwarwick)))
propri <- as.data.frame(c(disname='State Average',
                          proportion(state)))

## Note, I could have called proportion() inside of the rbind(), but I wanted
## my code to be clearer and felt there may be some use for the independent
## proportion data frames in further analysis. Sometimes more lines of code
## and more objects is easier to maintain and more flexible for exploratory,
## non-production code. This is especially true when handling such small
## data sets that there is no impact on performance.

locprop <- rbind(propwoon, proppaw,propprov,propww,propri)

## Some ggplot2 magic time!

localpropplot <- ggplot(locprop,aes(year, perlocal, color=disname)) +
  geom_line() +
  geom_text(data=subset(locprop, year==1995 | year==2008 |     year==2009),
            mapping=aes(year,perlocal,
                        label=paste(100*round(perlocal,3),'%',sep='')),
            vjust=-.4) +
  scale_y_continuous('Percent Change from FY1995',
                     label=percent) +
  scale_x_continuous('Year') +
  opts(title='Percent Change in Local Proportion of Per Pupil    Revenue\n Excluding Federal Funding, FY1995-FY2009') +
  opts(plot.title=theme_text(size=16,face='bold')) +
  opts(legend.title=theme_blank()) +
  opts(legend.position=c(.9,.65))
ggsave('localpropplot.png',localpropplot,width=10,height=8,units='in',dpi=72)

This post is the third of a three-part follow up on my guest post for Nesi’s Notes. Parts I and II can be found here.

July 9, 2012

This poignant post from Michael Goldstein ends with a few policy thoughts that largely support my previous post.

Goldstein’s second point is worth highlighting:

Anyway, in a small school, large-scale research isn’t the key determinant anyway. The team’s implementation is.

On the same day that Shanker Blog is assuring us that rigorous social science is worth it, Goldstein delivers researchers a healthy dose of humility. Rigorous research is all about doing the best we can to remove all the confounding explanatory factors that have an impact on our observed outcomes to isolate an intervention. But even in the most rigorous studies social scientists are often measuring the Average Treatment Effect.

How rarely do we truly encounter a completely average situation? The real impact in any particular school or organization can be dramatically different in magnitude and even direction because of all the pesky observed and unobserved confounding factors that researchers work so hard to be able to ignore.

So my advice? If you are down on the ground keep close to the research but keep closer to your intuition, provided you are ready, willing, and able to monitor, evaluate, and adjust.