Gender-Neutral Pronouns and One-Letter Words

English actually has a gender-neutral third-person singular pronoun: it’s “they”. Unfortunately, there is a crowd that will do everything they can to keep you from using “they” as anything but a plural. (They won’t catch every singular-they, of course, because it’s such a natural part of English that it often slips past them.) A ripple effect of their position is the periodic attempt to introduce new gender-neutral third-person singular pronouns such as “ze”. These are unfortunate because they add extra effort for both writer and reader when the use of “they” would be clear and simple if not for the constant threat of these pedants.

This same crowd will often decry the state of writing today with the spelling of “you” as “u” being one of their main bugaboos. I personally never spell “you” as “u”, even while texting, but surely one can see the basic logic behind it: the singular first-person pronoun pronounced like the letter “I” is in fact spelled with the single letter “I”; why shouldn’t the singular second-person pronoun pronounced like the letter “U” be spelled with the single letter “U”? This makes so much sense that I almost have to wonder about the basic sanity of anyone that thinks it’s a problem.

Anyway, here is my own proposal for a singular gender-neutral third-person pronoun. “I” is a singular gender-neutral first-person pronoun. “U” is a singular gender-neutral second-person pronoun. So let’s make “E”, derived from the common vowel sound in “he” and “she”, the singular gender-neutral third-person pronoun. We’ve solved a supposed problem and at the same time made English more consistent and logical. Win-win for everybody.

Posted in Language | Tagged , , | Leave a comment

End-of-Life Care

This article from the New Yorker (August ’10) hits home for me right now. But I come away from it still puzzled by the willingness of the doctors to keep treating even when they know there’s little to no chance of helping (and possibly even a good chance of making things worse).

This part stood out:

She absorbed the news [about her incurable cancer] in silence, looking down at the blankets drawn over her mutinous body. Then she looked up at me. “Am I going to die?”

I flinched. “No, no,” I said. “Of course not.”

A few days later, I tried again. “We don’t have a cure,” I explained. “But treatment can hold the disease down for a long time.” The goal, I said, was to “prolong your life” as much as possible.

I’ve seen her regularly in the months since, as she embarked on chemotherapy. She has done well. So far, the cancer is in check. Once, I asked her and her husband about our initial conversations. They don’t remember them very fondly. “That one phrase that you used—‘prolong your life’—it just . . .” She didn’t want to sound critical.

“It was kind of blunt,” her husband said.

“It sounded harsh,” she echoed. She felt as if I’d dropped her off a cliff.

Maybe it’s my hardened academic heart, but I find it hard to believe that people can be that sensitive. Not that I don’t believe the story—I do—but I think there’s something deeper going on with the patient than just the words her doctor used. I guess the challenge is in understanding what people are really feeling and responding to that rather than to the surface meaning of the words they say. I suppose it doesn’t surprise me that medical training leaves them unprepared for that. And I definitely don’t think I’d be any better at it.

Posted in Medicine | Tagged , , | Leave a comment

What Have I Done, part 2

This blog is already getting far more technical than I intended. I don’t want to do a post about R every day—R is just a tool I use to explore my questions about the world, and I’m hoping the R stuff is educational and inspires others to use R the same way.

I also firmly do not believe everything can be engineered, though my posts on improving graph readability for reviewers and hacking my own sleep might suggest I do. What I’m more interested in is uncertainty, and how we might take uncertainty into account when deciding on a course of action.

I intend to do a couple of R-less posts in the near future.

Posted in Meta | Tagged | Leave a comment

Hacking Sleep, part 1.5

This is just a technical followup to my previous post. I decided I don’t like wapply() for smoothing after all; it seems to be too dependent on the number of data points. So now I’m using a normal-density weighted average of points within a 95% confidence interval of about one hour—that is, I’m smoothing each point with every other point weighted by how close together they occurred, with the majority of the weight going to points within 30 minutes of each other.

The R code looks like this:

smooth <- function(time, y, sigma=900) sapply(min(time):max(time), function(t) sum(y*dnorm(time, t, sigma)))
sm <- smooth(d2$ZTIME-min(d2$ZTIME)+1, d2$ZINTENSITY)

And the smoothed plot looks like this:

The red line is a rough indicator of being awake—I was awake when the curve goes above that line.

Posted in Modeling | Tagged , , , , | Leave a comment

Hacking Sleep, part 1

For the last two years or so I’ve been struggling with insomnia. I typically go to bed around midnight and get up around 8, but in between I frequently wake up around 3 or 4 and feel like I’m awake for at least an hour on good nights, longer on bad nights. I seldom feel well-rested; when I do sleep well it’s a cause for celebration.

My doctor told me I need to establish good sleep habits. Unfortunately (or fortunately) I already have pretty good habits—to bed around the same time every day, up around the same time every day, no naps, no caffeine after lunch, etc—so it’s difficult to see where I can improve. What I need is data. My doctor is not in favor of doing a sleep study though.

As luck would have it, I was browsing through Apple’s App Store and came across a pretty neat-looking iPhone app: Sleep Cycle, billed as an alarm clock that wakes you up when most natural, but which actually collects data about your movements during sleep. I was only moderately interested in the alarm clock feature, as I tend to wake on time without alarms anyway, but I was very very interested in the data-gathering function.

The way it works is you put the iPhone on your mattress face down, and as you move around in your sleep, the iPhone’s accelerometer registers the time and intensity of your movements. Over the course of the night, it collects this data; in the morning you can look at a time-series plot showing when you were moving the most and when you were most still. (The app puts sleep state on the y axis. It’s not clear to me how valid this is, which I’ll get to below.)

Hacking the App
This is already very cool, but I want the raw data. So I went digging into the iPhone’s file system and discovered that the app stores the data in a SQLite database. I transferred this over to my laptop and opened it in R using the RSQLite package. I could then get all the data from the ZSLEEPEVENT table. Each row has a sleep session number, an event type (an integer that seems to be between 1 and 4; I’m not sure what the numbers mean), an event intensity, and a timestamp. The figure below shows the raw data that went into the final plot the app shows me.

Obviously the app is doing some smoothing to get its figure. I spent some time trying to replicate it, and came up with something fairly close using moving averages. I finally decided to use the wapply() function in the gregmisc library. This figure shows the smoothed data.

In the locations of peaks and valleys it’s fairly close to what the app shows, though in peak/valley height it’s pretty different. Over the course of a couple days I’ve found that these wapply() plots correspond better than the app plots to how I feel about my quality of sleep, when I remember being awake or semi-awake, when I remember making big movements, etc.

Hacking Sleep
What I really want to do is figure out what’s going on when I feel well-rested versus when I don’t, and what I might be able to do differently to feel more well-rested. Getting this sleep data is the first step. I also want to keep track of some other data about each night, such as whether I used any sleep aids, how late I last ate, whether I exercised, and so on. Then I want to look at all that with how well-rested I feel.

So I’m collecting all this data manually, rating my well-restedness on a 5-point Likert scale, and joining it with some features computed from the raw data. Right now I’m using area under the sleep curve, with greater area suggesting worse sleep. Another feature might be percent of total sleep time spent below some intensity threshold.

Once I have enough data, I’ll start looking for patterns. Hopefully I’ll be able to identify some things that I have control over and that consistently predict a good night’s sleep. This post is the setup; the next one will have some in-depth analysis.

Open Questions

  1. How well does movement intensity correlate to sleep state? My understanding is that in REM sleep, muscle paralysis sets in, so there’d be no movement. If that’s true, there must be some relationship. How strong it is, I don’t know.
  2. What other information can I compute from the raw movement data that I can hack on?
  3. Should I be comparing my sleep to a baseline? If so, how would I obtain that baseline?
  4. Will a future version of Sleep Cycle make it harder to access the raw data? Note to developers: I’d pay extra to be able to keep doing this.

Below the fold, some R code I used to extract the data and make plots.
Continue reading

Posted in Modeling | Tagged , , , , , | 1 Comment

Readable Graphs

I don’t know how it is for academic scientists in other fields, but me and my computer science colleagues review tons of papers—in 2010 alone I’ve reviewed more than 40 full papers.  As a reviewer, I appreciate anything authors do to make my job easier.  (And to be perfectly honest, I resent anything they do to make my job harder.  You’re asking me for my time; don’t waste it!)

Thus I’m always looking for ways to make my papers easier and more pleasant to review.  One thing I’ve been thinking about lately is making graphs.  It’s generally easier to make readable graphs in color than in grayscale.  These days we can use color because reviewers will receive an electronic copy of the paper in full color. Most of the papers I’m asked to review have full-color graphs. 

The problem, though, is that I don’t like to read papers on my monitor.  I like to print them out and lie on the couch with a pen and a beer, possibly with the TV on in the background.  To limit my wastefulness, I print them in the lowest quality grayscale.  The result is that many of these color graphs become unreadable—they were not designed to be looked at in black-and-white.

This isn’t just my problem. Some people are colorblind; many graphs use reds and greens that may be hard for a colorblind individual to distinguish. Some printers don’t print colors as they appear on screen; the wrong colors can get lost on paper. The moral is that it’s easier to throw together a decent-looking graph using color, but it takes more effort to be sure that graph is readable to everyone.

I want my graphs to look good in both color and grayscale.  The simplest approach is to use different line types (e.g. solid, dotted, dashed, dash-and-dot) along with different colors.  That way, even if the colors all come out the same shade of gray, the lines are still differentiable by their type.  But this is still asking the grayscale reviewer to do work that the color reviewer doesn’t have to do:  differentiating between line types with no color cues takes more cognitive effort than differentiating between colors.

So I’ve been thinking about how I can use colors that, when printed in grayscale, will come out as clearly different shades of gray.  I found Colorbrewer, a web-based tool that allows you to specify how many different colors you need; whether the data is sequential, diverging, or qualitative; and, best of all, whether you need the colors to be “photocopy-able”, meaning they’ll show up in black-and-white. It can also check whether colors are colorblind-safe and print-friendly. Colorbrewer is designed for coloring maps, and unfortunately some of the colors they suggest are far too light for a line plot with a white background. Nevertheless, I’ve found it very useful for my current crop of papers.

I’ll close this post with a sample of R code for a line plot I’ve been working on. This has four different classes of data; I used the “PuOr” scheme recommended by Colorbrewer.

plot(x, y, type="l", log="xy", xlab="x", ylab="probability")
lines(m1, lty=2, lwd=2, col="#5E3C99")
lines(m2, lty=3, lwd=2, col="#FDB863")
lines(m3, lty=4, lwd=2, col="#E66101")
legend(x="topright", c("empirical distribution", "model 1", "model 2", "model 3"), lty=1:4, lwd=c(1,2,2,2), col=c("black", "#5E3C99", "#FDB863", "#E66101"), bg="white")

R produces the color version on the left; the version on the right is how it should look when printed.

It’s not quite there yet—the two darker colors are a bit too close in grayscale—but it’s definitely better than not thinking about the problem at all.

Posted in Presentation | Tagged , , , , | Leave a comment

What Have I Done

I started a blog.  This could be a huge mistake.  I guess we’ll see.

Posted in Meta | Tagged , | Leave a comment