Wednesday, February 28, 2018

Learning Outcomes

I came across an interesting essay entitled "The Misguided Drive to Measure Learning Outcomes" by Molly Worthen in the NY Times Sunday review. In it, she bemoans the positioning of colleges as "glorified trade schools" rather than places of intellectual and personal exploration. She places much of the blame on the desire to quantify the student experience, arguing that not only does it trivialize the nature of intellectual pursuits by reducing them to checklists of desired outcomes, it also diverts focus from the larger societal factors (e.g., erosion of federal education dollars, unequal access to quality primary education, need to work part-time during the school year) that students face. 

As someone who greatly benefited from a "meandering" liberal education, I am very sympathetic to her argument. At the same time, I do wish that she had provided some references to her claim that "proponents [of learning outcomes] have struggled to provide much evidence -- beyond occasional anecdotes -- that [learning outcomes] improves student learning". Given that many folks in the learning outcomes movement are former educators themselves, a point the author makes explicitly, it would be nice to know specifically what evidence has, or has not, been amassed. And, in the case where some positive evidence exists, it would be important determine whether that evidence simply reflects movement on a scale purporting to assess e.g., "critical thinking" or actual evidence for the targeted ability.

That said, I found her essay a powerful reminder that the drive to become a "data driven" institution must be tempered with the recognition that there are unmeasured aspects of the college experience that may be more important.

I'll leave you with a quote from the article:

If we describe college courses as mainly delivery mechanisms for skills to please a future employer, if we imply that history, literature and linguistics are more or less interchangeable “content” that convey the same mental tools, we oversimplify the intellectual complexity that makes a university education worthwhile in the first place. We end up using the language of the capitalist marketplace and speak to our students as customers rather than fellow thinkers. They deserve better. 

Tuesday, February 27, 2018

We'll Do It Live!

As a student, I was never a huge fan of tests (who is?), but it was when I became an instructor that I really began to understand just how strange educational testing can sometimes be. 

After college, I got a job teaching English in Japan at a private high school associated "technical college" that shared the same campus. Unlike many of the foreign English teachers in Japan (at least at the high school level), I was hired directly by the school rather than through a third party program. This meant that I was responsible for creating and administering tests in my classes. 

At the high school, I was teaching a class called "English Conversation" to all of the students. There were over 600, and I saw them in groups of 45 or so once a week for 50 minutes. (In most Japanese schools, the students stay with the same "homeroom" group all day, and the teachers move from classroom to classroom rather than the other way around.) The students were what might be called "false beginners" -- they had been studying English for at least three years in junior high school, but tended to not have much in the way of productive ability. My lessons consisted of the usual tropes -- introductions, favorite things, daily schedule, etc. 

When the mid-term tests rolled around, I had only seen each group for a couple of classes. Nevertheless, I was expected to give them a mid-term just like all of the other subjects. Tests were by subject and class year, so all first year students would take their math test while all second year were taking their history test, and so on. I put together a short multiple-choice quiz based on the handful of phrases that I had taught up to that point ("How are you?  a) I am fine, b) I am a student, c) My name is Kenta, d) Yes, I do", etc.). I anticipated that the test would take about 15 - 20 minutes for the students to finish.

The evening before the exams, the lead English teacher told me that because the class was "English Conversation," I should deliver the test a "listening" test. Not only that, the test needed to fill the entire 50 minute exam period, otherwise the students might get rowdy and disrupt the "real" tests being given in the other subjects. Because there wasn't enough time to rewrite everything from scratch, the only solution was to deliver the test "live" over the school's PA system. (Because homerooms were grouped by class year on different floors of the building, it was possible to target just the relevant rooms with the PA system.)

The day of the test, I sat before the announcer's microphone on the school's PA system and proceeded to read my multiple-choice test out loud, as s-l-o-w-l-y a-s p-o-s-s-i-b-l-e to take up as much of the 50 minute period as I could. Towards the end of the quiz, when I was really trying to stretch things out, I think that there was a good 5 seconds or more between the item number, the prompt, the letter of each option, and the text  of each options. Try it yourself to get an idea of how absurd the whole thing sounded:

1. (5 sec) How are you? (5 sec)
  a. (5 sec) I am fine (5 sec)
  b. (5 sec) I am a student (5 sec)
  c.  (5 sec) My name is Kenta (5 sec)
  d. (5 sec) Yes, I do (5 sec)

After this dismal mid-term experience, I tried to create a longer "script" for the final exam, enlisting the help of another English teacher to play my counterpart in short conversations and basing the questions on the contents of the conversations rather than grammatical points. This was better, but we were still trying to speed up or slow down the delivery based on the amount of time left in the test period, and the absurdity of the situation caused us to giggle uncontrollably throughout -- thank heavens for the mute button on the PA console!

By my third go round, I had moved to prerecording everything on cassettes. The moral of the story?  Never try to do a listening test "live."

Saturday, February 24, 2018

Steve Jobs Invented the Computer

Without trying to make this blog too political, one of my pet peeves is the general lack of appreciation for the impact of government investment in research on the technology that we take for granted in our lives. Perhaps this is because much of my career has been spent in jobs that are supported by federal or state funding (via grants, contracts, and/or by virtue of being employed by a state institution). Because of that, I tend to bristle at the suggestion that such institutions are a "waste" of taxpayer money and that "the private sector" is the place where "real" discoveries and innovation happen. I would not surprise me to find people who literally believe that Steve Jobs (or Bill Gates) invented the computer. 

As an occasional C-SPAN junkie, I recall Senator John McCain, in his role as chairman on the Senate Armed Services Committee, make a statement to the effect that cutting edge innovation in Silicon Valley makes things cheaper, so why are government research programs so expensive? In my mind, this is conflating three different things -- basic research, applied research, and commercialization of research.* It is most likely true that non-government entities do a better job of commercializing and mass producing technology, which makes it "cheaper," but by that point, the technology has probably already benefited from decades of research supported by millions (or billions) of dollars of government funding. Not to trivialize the role that companies play in commercialization, but this is kind of like giving the server in the restaurant all of the credit for the meal simply because they carried it from the kitchen to your table, ignoring the fact that someone had to create the recipe, grow and harvest the food, prepare the meal, etc.

The trigger for this post was actually a TED talk that I happened upon a few days ago by Mariana Mazzucato. She is an economist whose research focus is the role of government funding on innovation. The talk is from 2013, and based on one of her many books. (I'll need to check those out.) Though I had never heard of her before nor read any of her work, her presentation is much more eloquent that I could ever be.  



----

*To be fair to Senator McCain, the context was cost overruns on weapons programs, which have all sorts of mismatched incentives and unrealistic initial cost estimates, so they probably are more inefficient than they should be. (And because there was insufficient money allocated to research and testing of those cutting edge systems before production.) That said, I think the underlying assumption is that the private sector and the government do the same things, but one can do them much cheaper than the other.  (And since government contracts go to "private sector" companies, that kind of proves my point anyway.)

Friday, February 23, 2018

Plotting in Pandas: A Cautionary Tale

OK, so we're actually plotting via matplotlib, but that lacked the alliteration needed for a decent title.

This is a follow-on post to one a couple of days ago about plotting some "log"-ish information from our LMS. The idea is to visualize the types of action (what the learning is doing) / application (which part of the LMS the learner is using) patterns for several different learners. This time, I was trying to illustrate the relative frequency different patterns across students.

We'll start by creating some fake data again. We have five learners, some of whom have performed a random subset of actions across a subset of applications. (I'm sure there are much more compact ways of generating fake data, but I'm the kind of person that needs to think it through step-by-step.)


import pandas as pd
import numpy as np 
import matplotlib.pyplot as plt
%matplotlib inline
 
application = ['files', 'discussion', 'assignment', 'quiz', 'wiki', 'announcement']
action = ['show', 'index', 'create', 'backup']
names = np.array(['alice', 'bob', 'charlie','dorothy', 'ellen']) 

student = np.repeat(names, [100, 100, 100, 100, 100], axis=0)
applications1 = np.random.choice(application[:4], 300, replace=True) # subset
applications2 = np.random.choice(application, 200, replace=True) # all
actions1 = np.random.choice(action[:4], 300, replace=True) # subset
actions2 = np.random.choice(action, 200, replace=True) # all 

applications = np.concatenate((applications1,applications2))
actions = np.concatenate((actions1,actions2)) 

df = pd.DataFrame({'id':student, 'web_application':applications, 'web_action':actions})
df.head()

This gives us a data frame with learners, actions, and applications.


We can do some aggregation in pandas to make a chart of the frequency of each action/application combination for each learner. We'll count and sort the values as part of the process, saving each resulting aggregation to a list. At the end, we'll plot one of the list elements (the results for 'charlie') to make sure things look as expected.

 # get the list per student
names = ['alice', 'bob', 'charlie','dorothy', 'ellen']

df_list = []
for name in names:
    mytemp = df[df['id'] == name].groupby(['web_action','web_application'])['web_action'].count().sort_values()
    mytemp.name = name
    df_list.append(mytemp)

df_list[2].plot(kind='barh', title=df_list[2].name)

This gives us:


Not bad. We could repeat the process for each of the elements in the list to get a plot for all of the students if we wanted. But wouldn't it be nice to all of the students together in one plot? That's what I thought, and that's where the cautionary tale part of the story comes in.

I haven't done a whole lot of plotting in Python, but working out some of the initial kinks of properly  specifying subplots, I managed to create a single plot with the information that I wanted. Unfortunately, the plot seemed a little busy in terms of labeling.
fig,axs = plt.subplots(3,2, figsize=(20,15))

for i in range(0, len(df_list)):
    df_list[i].plot(kind='barh', title=df_list[i].name, ax=axs.flat[i])




Wouldn't it be nice if we could clear up some of the clutter by getting rid of the y axis label and having the plots share the tick labels? That led to my next plot.


fig,axs = plt.subplots(3,2, sharey = True, figsize=(20,15))

for i in range(0,len(df_list)):
    df_list[i].plot(kind='barh', title=df_list[i].name, ax=axs.flat[i]).yaxis.label.set_visible(False)


Much less cluttered, which is good. Unfortunately, sharing the y axis tick labels makes the chart, well, wrong. Although a superficial glance makes it look as though things are working --some students had fewer possible application/action combinations, so there are the expected gaps for the expected students-- closer inspection reveals that sharing the y labels has led to mislabeled information for the majority of the subplots. Things are aesthetically pleasing, but not correct because the data are not in the same order across the students. (I know, I know...duh!)

Rather than putz around some more, I decided to revert back to the previous version. The moral of the story is that oft repeated dictum that computers are stupid and they will do what you tell them to do (even if you told them to do something stupid), so always double-check.

Thursday, February 22, 2018

College Kids These Days

I recently read an article entitled "What's college good for?" by Bryan Caplan in The Atlantic.  The article was based on his book The Case Against Education, which I have not read. Although the article makes for some interesting reading, the author's main point seems to be that college kids these days are lazy, stupid (no one has actually earned their 4.0 GPA due to rampant grade inflation), and woefully unprepared for the workforce. He suggests that the only value in a college degree is the "signaling" that it provides to potential employers -- hey, this kid got through Yale, therefore they probably have some decent skills even if they did major in a "ridiculous" field like literary criticism.

Caplan seems to suggest that vocational education would be much better for many would-be college students and for the society at large. Does the world really need more sociology majors? Exactly what kind of job are they training for?

There are no specific research studies cited in the article, although there are nods to what "teams of researchers" have found (much of the information mentioned seems to be at least a decade old, however). Caplan seems to want a better match between education and job skills, but it is unclear what that would look like. Much of the job growth since the great recession has been in low wage jobs, though there have also been some gains in relatively technical fields. Of course, even majoring in a technical field is no guarantee that you will find employment. Perhaps we need educators who can better help students predict the future?

It is unclear exactly what Caplan sees as the solution. Is he suggesting more rigorous student tracking in early education, where folks who are not college material are diverted into vocational programs? (Does working fast food count as a vocation?) Does he envision a cap on the number of degrees to confer for "useless" majors, in an effort to push students into the "correct" course of study?

I admit to not understanding his thesis, which he states as follows:
My thesis, in a single sentence: Civilized societies revolve around education now, but there is a better, indeed, more civilized--way. 
Perhaps I would understand his argument better if I read his book. Or is "book learning" the cause of the problem in the first place? 
       

Wednesday, February 21, 2018

Plotting Crosstabs in Pandas

This post is primarily to remind myself of a solution that worked for me. I was analyzing some request table data from our LMS provider. (The request table is derived from log files.) To get a rough and ready estimate of what students were doing in the LMS over the course of a semester, I wanted to create a contingency table from two of the columns: web_application_controller and web_application_action, which specify how the web request was serviced (an assignment was created, a discussion was viewed, etc.)

(I'm still working on getting code snippets to look good in these posts. Bear with me.)

First, we'll create some fake data by randomly creating 100 request records for each of three students, each consisting of an application and an action:

 import numpy as np  
 import pandas as pd  

 application = ['files', 'discussion', 'assignment', 'quiz']  
 action = ['show', 'index', 'create']  
 names = np.array(['alice', 'bob', 'charlie'])  

 student = np.repeat(names, [100, 100, 100], axis=0)  
 applications = np.random.choice(application, 300, replace=True)  
 actions = np.random.choice(action, 300, replace=True)  

 df = pd.DataFrame({'id':student, 'web_application':applications, 'web_action':actions})  
 df.head()

This gives us the following:

Next, we create a create a table of the count of requests per student, using Pandas crosstab:


 df_cross = pd.crosstab([df.id, df.web_action], df.web_application)
 df_cross

This results in:

This was what I wanted, but I couldn't figure out a good way to plot the results. After lots of searching, I came across an answer (I'll try to track down the original) which involved "flattening" or "tidying" the table, using Pandas melt function (which is just like R's melt). Note that we have to reset the index as part of the process.


 df_cross_melt = pd.melt(df_cross.reset_index(), id_vars=['id', 'web_action'], var_name='web_application', value_name = 'count')
 df_cross_melt.head()

From there, it is possible to use Seaborn's factorplot to visualize the results:

 import matplotlib.pyplot as plt
 import seaborn as sns
 %matplotlib inline

 g = sns.factorplot(x='web_application',
                  y='count',
                  hue='web_action',
                  col='id',
                  kind='bar',
                  data=df_cross_melt,
                  sharey=True)

 g.set_xticklabels(rotation=90)
This produces the following chart:


I'm sure that there are much more efficient ways to do this, but this worked for me and got me the result that I needed.

Tuesday, February 20, 2018

Rubick's Cubicle

The arrangement of office space can be a puzzle. Does an open work space promote more collaboration? Do private offices create resentment and isolation? Does the height of cubicle walls matter?

I will be the first to admit that I haven't taken the time to read the research literature related to this topic. (Though if you believe a reporter-generated synopsis of the general findings, open office plans don't work.) My take on the issue is based on experience and gut feeling. In my mind, the arrangement of the office serves to attenuate whatever positive or negative feelings you have towards your situation (in addition to whatever measurable effects they might have on noise, productivity, etc.)

I've been in shared offices, both with and without windows to the outside world; in private offices, with and without windows; in a completely open office setting (no cubicles whatsoever); and in a shared space with low-walled cubicles. Although I was always working with people whose company I enjoyed, I found the low-walled cubicles the worst of the bunch -- although they provided a physical demarcation, the cubicles were far too close to each other to provide any feeling of personal space. The completely open office setting led to everyone wearing earphones to cut down on distractions (though it did have the advantage of seeing who was "available" at any given point in time). Being in an office, even if it is shared, gives a sense of permanence. Cubicles give a feeling of being replaceable/interchangeable. 

But it is not just the office layout that is important. If the space itself is nice (the chairs are comfortable, the technology is modern, the temperature control is adequate, etc.), that can help. A mold-infested private office in a dank basement is probably less desirable than a shared office with natural light or even a decent cubicle. 

At the end of the day, the office environment tells a story about how the organization views its workers. If there is a mismatch between the environment that an employee feels is a prerequisite to performing at a professional level and that which is provided, there will be tension. Employees usually want a sense of ownership and autonomy, and that can be more difficult to engender in a shared or open space that feels "temporary." (It is curious that managers rarely, if ever, believe that shared offices will make themselves more productive.) A substandard or ill-conceived working environment can make statements like "We value our employees" ring hollow. 



 

Saturday, February 17, 2018

Better than nothing?

I've been reading various online articles and blog posts about the replication crisis in science (particularly psychology), replete with examples of potentially spurious research results that have become widespread beliefs . Some have even argued that this is becoming increasingly unavoidable given the nature of incentives that tend to operate in academia.

Although there are obvious and non-trivial differences between academic research and test development, this made me reflect on a debate that occurs in language testing (or educational testing in general) -- when is having no test better than having a bad test? In other words, at what point do the ramifications of having a bad (poor reliability, insufficient construct validity, etc.) test outweigh whatever benefits it might have?

Because tests are usually employed to make some sort of decision -- placement, selection, achievement, diagnosis -- the benefit of a test is its utility in providing information to help make that decision (which could be as mechanical as "anything above 80% correct is sufficient for credit in this course"). It is easy to proclaim that one should never use a poor test, but that assertion is of little use to those responsible for whatever decision needs to be made. Your current placement test might not be very good, but that knowledge alone doesn't help you place 1,200 students into appropriate language classes at the start of the semester.

But what are the effects of a bad placement test? If the test results are treated uncritically, weak students who are mistakenly placed into difficult courses will be seen as "lazy" or their instructors seen as "incompetent." At what point to those knock-on effects become problematic?  Placement testing is a particularly interesting area, because placement is a function of both the student and the curriculum. The extent to which the test "works" is dependent on the quality of the curriculum (i.e., if there is a mismatch between the available courses and the student population, you will never find the "perfect" placement test).

As I write this, I realize that the real analogy is not between testing and research, but rather between testing and peer review / tenure decisions / "impact" metrics and the like. It is easy to point out flaws in the system, but it is much harder to determine an appropriate solution. The question is, at what point is nothing better than the something we currently have?

Friday, February 16, 2018

A Room with a View

For a long time, I thought that I would probably never top the office that I had at the University of Hawai`i as a graduate student. A graduate student with a nice office? How could that be?

Long story short, I was the beneficiary of a fortuitous set of circumstances.

My department was in Moore Hall, a five story building on the flagship Manoa campus of UH. Faculty had offices primarily on the fifth and fourth floors, usually with windows to the outside world, while graduate students, if they were lucky enough to have an office at all, would share rooms in the interior of the building. (Many of us were convinced that these "offices" where just re-branded closet space.)

One year, the "corner office" on the fifth floor became vacant when a faculty member left. However, the faculty member who should have been next in line for that space declined the offer. (His office was packed with stacks of materials and he didn't want the bother of moving everything to a new location.) As a result, a group of us GAs (graduate assistants) became the proud inhabitants of one of the best rooms in the building, with an expansive view from Manoa Valley down to Waikiki (and Diamond Head, if you looked just right). 

But it gets better. Not only was the room itself beautiful, one of my office mates was quite the aficionado of fine coffee. He had apparently struck up a deal with a local coffee shop to sell him a couple pounds of green coffee beans which he would occasionally roast in small batches on the weekend. During the following week, we would chat about research and life, while gazing out of our fifth story window and sipping coffee made from freshly ground, hand roasted beans.

That said, I think that my current space in the newly opened Edward St. John Learning and Teaching Center is giving my Hawai`i office a run for its money.

 

Thursday, February 15, 2018

Do we know anything?

Every once in a while, I have an existential crisis about whether or not we can ever know anything (in the social sciences, that is). The genesis is almost always reading an article (e.g., Why most published research findings are false) or blog post (like the timeline at the bottom of this post by Andrew Gelman) about the lack of empirical evidence for even popular theories once statistical issues in the original papers have been corrected (compounded, of course, by the publication bias, researcher degrees of freedom, etc.). 

There is a wonderful clip of the great physicist Richard Feynman talking about "pseudoscience" (which seems to include the social sciences in his view). I think that this was originally aired as part of a BBC or PBS special. In it, he says the following:
Now, I might be quite wrong. Maybe they [so-called "experts" in social science] do know all those things. But I don't think I'm wrong. You see, I have the advantage of having found out how hard it is to get to really know something, how careful you have to be about checking your experiments, how easy it is to make mistakes and fool yourself. I know what it means to know something. And, therefore, I can't...I see how they [social scientists] get their information, and I can't believe that they know it. They haven't done the work necessary, they haven't done the checks necessary, they haven't done the care necessary. I have a great suspicion that they don't know [what they think they know] and they're intimidating people by it. I think so. I don't know the world very well, but that's what I think. 
Although Feynman is quite harsh in his criticism and one could easily throw up one's hands in defeat after reading this, I always find this quote comforting. Even if we don't really know what we think we know, things are not, in principle, unknowable. In other words, there's always hope.

Wednesday, February 14, 2018

Optimists and Pessimists

I've always considered myself a realist, though I think that comes across to many people as being pessimistic. That doesn't mean that people consider me morose or anything, as far as I can tell, but rather that I tend to gravitate towards counterarguments rather than support when hearing of a new idea. (Of course, like virtually everybody else, I have cognitive biases that attenuate my search for counterarguments when it is my idea under discussion.)

I'm not against folks looking on the bright-side, as long as they don't become blinded to potential dangers (i.e., "we don't have to worry about climate change, because everything will work out for the best"). Life can be hard and not necessarily fair. The best ideas don't always win, and just "being positive" is no guarantee that everything will be OK. Barbara Ehrenreich wrote about the dangers of pervasive positive thinking in her book Bright-sided: How positive thinking is undermining America. 

Just as trying to make the best of a bad situation is a reasonable strategy, so is taking a bit of time to think about what could go wrong and taking steps to mitigate it. I wish I could remember where I read this, but I've found that this quote nicely sums up what I see as a role for both positive and cautious approaches to life:
It takes an optimist to invent an airplane, but a pessimist to invent a parachute.  

Tuesday, February 13, 2018

What seems to be the problem?

I've been reading Barbara Oakley's book A mind for numbers: How to excel at math and science (even if you flunked algebra). Although the book nominally makes reference to math and science, it is actually a more general set of recommendations on how to study based on research in cognitive science. One of the insights in the book is that we can sometimes narrow our search space prematurely when trying to discover the answer to a problem. This can lead to a sub-optimal solution, perhaps even no solution, as we have framed the problem in such a way as to exclude a more fruitful path of exploration.

This happened to me this past weekend as I was trying to play around with the Extended MNIST (EMNIST) data set which includes both handwritten digits and handwritten letters. I had been working through a Tensorflow tutorial on training a classifier on the handwritten digit MNIST data (which is kind of like the "hello world" of machine learning) and I wanted to extend it to letters as well. Because of its ubiquity as an example, Tensorflow includes a script to download the MNIST data set. I was modifying that to read the EMNIST data that I had downloaded to my local machine.

Even though I had changed the variables which referred to the EMNIST files rather than the MNIST files, I couldn't figure out why I was getting a cannot open file error. My assumption was that it had something to do with how I was setting the relative path to the files, as the original script will go the the internet to download the data if it is not found locally and that where I was making the bulk of the changes. However, no matter what I tried (including specifying absolute rather than relative paths), I kept getting the same error. It was only after an inordinate amount of time that I realized my error was a typo* in the file name rather than an error in the logic of the program itself (emnist-byclass-test-labels-idx1--ubyte.gz versus emnist-byclass-test-labels-idx1-ubyte.gz).

The moral of the story is that it pays to take a step back and consider additional possibilities for where a problem lies rather than rushing headlong into the first possibility.


*If you couldn't see it, I'm talking about the extra hyphen.

Saturday, February 10, 2018

Syntactic Interference

In second language acquisition research, there is a concept known as interference. The core idea is fairly simple and refers to the influence that one known language has on the use of another for a person who speaks multiple languages. Having a "foreign accent" may be an obvious example of interference on pronunciation, but there can also be syntactic interference (influence on grammar) lexical interference (influence on words).

This same phenomenon can be seen in programming languages. Subtle variations in function names or usage can be sources of interference, such as R's head(df)versus Pandas df.head() or Python's len()versus R's length().  There are also more global issues such as how one expresses their intentions over several lines of code. Just as it is possible to make yourself understood in another language even if you don't phrase things the way a native speaker would, one can write working code which is regarded as "not Pythonic" by an expert programmer. 

Perhaps this explains why my code sometimes feels like gibberish.   

Friday, February 9, 2018

"You're out of order!"

If you've ever seen the movie ...And Justice for All, you will do doubt vividly recall Al Pacino delivering that famous line during the film's climatic courtroom scene. This post is about a different kind of order -- the order of sorted data.

I was almost tripped up by order recently while munging some survey data for analysis. The survey had been taken by representatives of various academic and service units on the university campus and this was the second year it had been administered. I was attempting to match the current year's respondents to previous respondents to investigate change from one year to the next. This was not the straight-forward process that I assumed it would be, as some of the drop-down options for the "demographic" (in terms of where the unit is in the university hierarchy) questions had been altered between the two years. In addition, folks sometimes filled out a single survey to cover multiple units, so one had to look at a comment box to see if they had made any annotation to that effect (e.g., "this survey also covers unit X, Y, and Z"). Because there was no guarantee that the same units had responded to the survey each year, this also meant that one had to recognize that units with similar names across the two surveys may not refer to the same entity (e.g., Chemical and Molecular Bioengineering, Biochemistry, and Bioengineering are not necessarily the same thing). 

I spent a bit of time trying to come up with a principled way to do this in R, but decided that it might be more efficient to just do things "by hand" as there were only about 100 survey responses. The data were in .csv format, so I grabbed the relevant columns from each survey, pasted them into separate workbooks in Excel, and compared them side by side. Each time I found what I determined was a "match," I would grab the unique id for that respondent in the current survey and paste it into a new column in the other sheet. Once I had matched all that I could, I pasted that new column into the survey response data from the previous year. That column was the link between the current year and the previous year.

At a couple of points along the way, I sorted the Excel sheets (sometimes on multiple columns) to make this visual comparison easier. For better or for worse, Excel does what you tell it to (usually). If you sort on multiple columns, and then later on a single column, Excel will maintain the current order for everything other than the column you are sorting on. Though I re-sorted on what I thought was the "main" column before pasting the final results into the original spreadsheet, I didn't double-check the final order. Had I done so, I would have realized that things were still not quite back in the "original" order. It was only at a later stage in the analysis that I realized my mistake. Ouch.

The moral of the story is to always keep track of any data permutations you are performing, particularly when using tools that do not naturally leave a digital trail. (This is why I prefer to work in R or Python and make modifications to data objects rather than the original data source -- you can always modify the script and rerun the process staring from the "original"data.) Had I simply added an "original position" column to the Excel sheet before doing any sorting, I could have easily sorted on that to get back to the starting state.

Thursday, February 8, 2018

2 + 2 = 5

I'm not very good at math. That's a bit of an ironic statement given that most of the jobs I've had since graduate school have been fairly quantitative. And to be clear, I'm not saying that my calculus has gotten rusty since I took an AP class in high school or that I don't remember much about trigonometry. I never took calculus, AP or otherwise, nor pre-calc, nor trig. And it isn't that I just haven't taken advanced math classes -- my "basic" math skills are not as strong as they should be. What happened?

My recollection is as follows. Back when I was in 6th grade, I took a pair of tests. One test was to see if I could skip 7th grade math, the other was to see if I could understand abstract concepts (i.e., the letter "x" representing an unknown value in an equation). Passing both tests meant that you would take pre-algebra in 7th grade, algebra in 8th, geometry in 9th, trigonometry in 10th, pre-calculus in 11th, and AP calculus senior year. (This was a a couple of decades ago -- I'm sure the math curriculum has changed several times since then.) Although I initially passed both tests, it turns out that there was a grading error and I really didn't have sufficient command of "basic" math skills to warrant skipping "regular" math in 7th grade. In other words, I don't have problems with the notion of abstraction, I just have trouble actually "solving for x" in the real world.

Needless to say, I didn't do very well in math in high school. (I think I took algebra twice.) At the time, only two years of math were required, so I never took anything past geometry (though I did take a single "consumer math" course as a college undergrad to fulfill a graduation requirement there). As I had little interest in pursuing any career that required mathematical knowledge, I wasn't too worried about my lack of mathematical background. After college, I got a job in Japan teaching English as a foreign language didn't give it another thought. I knew that I wasn't good in math, but (I thought) it didn't matter.

I became acutely aware of my math deficiencies in graduate school, when my interest in teaching English as a foreign language morphed into an interest in second language acquisition research and language testing in particular. In addition to readjusting to life as a student almost a decade after graduating college, it was painfully obvious that I was missing some of the foundational building blocks for the stats classes I was taking and the research literature I was reading. Although I've managed to get by (research and assessment are never JUST about the numbers), I still feel like an English Literature major who only read the Cliff's Notes version of the Western cannon.

I guess I'm living proof that you can have a fairly data heavy career even without a solid background in math. That said, I really don't recommend it. Building up your skills early if possible is probably a much better approach. 

Wednesday, February 7, 2018

You are what you do

When I was in my teens, I used to attend a camp in upstate New York called High Peaks, where we would spend most of our time climbing and canoeing in the beautiful Adirondack Mountain Reserve. As campers, we were expected to pull our weight when it came to carrying food, gathering firewood, etc. However, one thing that campers were not allowed to do (at least during my time there) was to fill or light the kerosene lantern that we used for light in the evenings.

For my last year at High Peaks, I returned as a counselor. Suddenly, my job included lighting the lantern. Although lighting the lantern is trivially easy if you have seen others do it in the past (and even if you haven't), I found it interesting that I had never been required to demonstrate this ability prior to being hired, particularly given that I had been forbidden from touching the lantern as a camper. My lantern-lighting knowledge did not suddenly change by virtue of being hired as a counselor.

In other words, for better or worse, you are identified by your title, and there are general expectations as to the types of skills and knowledge implied by that title, even if you were not required to explicitly demonstrate them prior to being hired. (No hiring process can be comprehensive.) 

I've noticed this feeling since then, particularly when starting a new position (which, in my case, has always involved moving to a different organization). My experience has never been "same job, different organization." Every time I've changed jobs, I've always been required to do things that I've never really done before (though I certainly have acquired general skills that are transferable to different contexts). I always feel that there is much more to learn to "live up to" the job title. 

At the same time, job titles are usually a poor measure of ability. Whether or not it is part of your degree or job title, if you create websites in your spare time, then you are, at some level, a web developer; if you play an instrument, you are a musician; if you analyze data, you are a data analyst; if you do watercolor, you are an artist. This doesn't necessarily mean that you are a great web developer (or musician, or data analyst, or artist), but that is a different issue.     


Tuesday, February 6, 2018

Luck

I recently read a book called Success and luck: good fortune and the myth of meritocracy by Robert H. Frank. The basic thesis is that those who are successful in getting a job, being accepted to a university, etc., are virtually always (perhaps always) luckier than those who failed to do so. However, due to cognitive bias, people tend to underestimate the role of luck in their success and attribute all of their favorable outcomes to their superior intelligence, work ethic, foresight, and the like. Enjoying the fruits of one's hard work is not necessarily a bad thing, but the troublesome corollary to this cognitive bias is that such people tend to attribute others' lack of success to a deficiency -- not smart enough, didn't work hard enough, etc. (I heard the term "weaponized self-help" recently that is along the same lines -- people don't fail because of racism, sexism, ageism, etc., they just didn't "believe" in themselves enough.) This can cause us to treat others as "inherently" lazy, unmotivated, or intellectually limited, and provides a convenient excuse to avoid uncomfortable questions of privilege (e.g., white, male) as factors in the increasingly unequal distribution of wealth in the society.

I don't want to get too far afield in the social/political aspects of the author's thesis. One thing that was interesting in the book is that the author mentioned results of a statistical simulation as part of his argument. The basic idea is to create a set of simulated job hunters, college applicants, etc. each with a random value for  "strength" (or intelligence, inherent capability, or whatever else you want to call it) and a random value for "luck". These values are drawn from a uniform distribution between 1 and 100, so any value in that range is equally probable. Next, a composite variable called "performance" is created, which is the weighted sum of the strength and luck variables. For example, if you believe that luck plays a very small role in performance, you could set performance = (strength * .95) + (luck * .05).

I decided to implement this with a simple R script and apply it to some data. A quick web search shows that there were 39,494 applicants to Harvard for the class of 2021, and that 2,056 applicants were accepted. I created a "strength" vector and a "luck" vector of 39,494 draws each (the applicants) from a uniform distribution between 1 and 100,  and then a "performance" vector of the same length (representing the overall "score" of the application package), with strength accounting for 98% and performance 2% of the score. These were all combined into a dataframe. I then ordered the dataframe by performance (high to low) and split the top 2056 records (the successful applicants) from the others (the unsuccessful applicants). Using R's summary() command, I captured the median "luck" score for each group, along with the minimum strength score in the successful group and the maximum strength score in the unsuccessful group. This process was repeated 1000 times.

My simulation showed that the median "luck" value for the "chosen" group was 55.33, while the median for the "not chosen" group was only 50.24. (A t-test confirms that these are statistically significantly different.) This suggests that, indeed, the chosen group were "luckier."

The average minimum "strength" score for the chosen group was 93.92, while the average *maximum* score for the "not chosen" group was  96.19. In other words, the chosen group were not "the best of the best," but rather "the luckiest of the best."

It is important to note that the takeaway from this is NOT that personal effort doesn't matter or that it is ONLY a matter of luck that people are successful. Obviously, the harder one works the more likely they are to be in a position to take advantage of a "lucky" break. The important point is that is a mistake to equate lack of success with lack of personal effort or ability. As the old saying goes "better to be lucky than good."

Friday, February 2, 2018

Thank You for Sharing

I recall reading something many years ago that talked about the distinction between material things and ideas. If you have a hamburger and decide to share it with someone, you have less than you would have otherwise. In fact, because the hamburger is finite, there is a limit to how many people you can share it with while still retaining some benefit for yourself. With ideas, on the other hand, you get to keep the "whole" idea even if you share it with others. (Determining appropriate attribution for an idea is a whole different set of issues.) One can consider computer code the expression of an idea which, given digital distribution, can be shared with others without reducing the benefit to the creator.

As an almost daily user of either R or Python, I am in awe of the extensive ecosystem around these languages. Although I'm not a free (as in libre) software purist (I've tried at times, but forces conspire to push me back to "what everyone else is using"), I greatly appreciate the efforts of people who contribute their ideas to these projects in the form of code and documentation. Thank you for sharing!

Large-ish data, or "Where should I put this?"

When I was collecting data for research studies while working on my degree in second language acquisition, the "golden number" was 30. If you could somehow get at least 30 language learners to participate in your research experiment, you were good to go. (This reminds me of the old joke: "How many statisticians does it take to change a light bulb?" "At least 30, but a really good one can get away with as few as 25.") As my focus turned more towards language testing, 30 seemed a little small, and the "rule of thumb" for using Rasch measurement was "at least 100." I had somewhere north of 400 test taker responses for my dissertation work, which I was happy with. When I was working as Assessment Director of a federally-funded language research center, we could normally get thousands of test takers to pilot a commonly taught language like Spanish, with considerably fewer for less commonly taught languages like Hindi or Urdu. For all that time, I never had an issue processing data on whatever desktop (or, increasingly, laptop) computer I happened to be using.  (I seem to recall a brief period of time circa 2007 when in Excel would sometimes choke on our biggest data sets, but that easily overcome by upgrading to the most recent version.)

Recently, however, I've been working with data from a learning management system (LMS) that serves over 40,000 students and instructors. A "data dump" of information from the system consists of over 80 informational tables which, for reasons I won't go into here, we only have access to as flat files. Although most of the files are only a few hundred megabytes in size, some are several gigabytes, and one is so large that attempting to decompress it (files are downloaded in a compressed format) resulted in an "out of space" error on a 1TB drive. Even for the "smaller" files, manipulating them in R (our languages of choice) through joins and the like can quickly lead to memory issues. This is not "big data" by any means -- a modern computer with a multi-TB hard drive should be able to hold it all -- but it is large enough to be quite unwieldy for someone like me who has never needed to be concerned with memory-efficient processing or having enough storage space. There seems to be a gap between "big data" solutions (I certainly don't need a Hadoop cluster for a couple TBs worth of data) and "standard-issue" office computers.

The moral of this story is that having a "right-sized" data infrastructure in place is important, and just having years of experience in "data analysis" doesn't necessarily make you fluent in working efficiently with "larger-than-memory" data. There's a lot for me to learn.

Thursday, February 1, 2018

Blog Reboot

Several years (and embarrassingly few blog posts) ago, I started the Third Distractor as a place to ruminate on issues related to foreign language and assessment. (The blog's name refers to a common test writing experience; in a typical multiple choice test with four options, writing the third "wrong" answer, or distractor, tends to be more difficult than writing the first two.) Although I managed to write a few entries, blogging did not become a natural part of my routine and I was much less prolific in my postings than originally intended.

Fast forward to now. After a cross country move and a couple of career changes, I no longer work on language test development for my day job (though I still do some consulting, and recently co-taught a course on language assessment). In my current position as data scientist at a large public university, I spend most of my time wrangling educational data from a learning management system and a variety of surveys. Nevertheless, I have found that the notions of validity, context, and score interpretation still have a place in my thinking about working with educational data in general. Working in several different organizations has also given me a chance to see how different folks manage people, projects, and crises, all of which has been enlightening.

I've decided to try to resuscitate this blog and use it as a place to externalize some of the thoughts swirling around in my head as well as keep track of data wrangling tips and tricks that I've found useful. I'm doing this mainly for myself, but perhaps others will find a useful nugget once in a while.

I suppose it wouldn't hurt to update the profile pic either...