Friday, June 29, 2012

"El Diablo" and the Trail Peñalara 60k

"Seis, Seis, Seis!!"
"Seis! Seis! Seis!"  "Si, Si, El Diablo!"  Ordinarily, my race (bib) number doesn't garner much attention during a race but this one was different since I had the dubious distinction of wearing 666, the number often associated with the anti-Christ, Satan, the devil, etc.  I'm not a religious fellow so I didn't assign much significance to my bib number when I discovered what it was although it was a bit unsettling if I thought about it too much.  Was it just a coincidence?  An ominous portent of how my day would unfold?  Or did the race organizers have a twisted sense of humor and assign the number to the only runner from Austria knowing that Adolf Hitler --- the modern-times anti-Christ --- was, in fact, born in Austria?  Either way, I couldn't bother dwelling on it:  I had a race to run.  And this race, unlike any other ultra I've run, was on European soil.  I've been living in Austria for nearly two years and although I had a race scheduled for August 2011, I had to withdraw because of a bout with acute Achilles tendonitis.  After I recovered from that injury, I was determined to stay healthy to run at least one, perhaps two, ultras in 2012.  The first race I chose to run --- the Trail Peñalara 60k --- is the shortest of three races available (60k, 80k, 110k) and one long enough (~37 miles), technical enough, and with enough cumulative vertical gain to keep the pace slow and difficult (2586 meters = ~8,484 feet).  

When the race finally started --- just after 9AM on Saturday, June 23rd --- it was already pretty warm, I wasn't too confident about how hydrated I was, and I suspected I'd be dealing with a low-level upset stomach most of the day.  The night before Lisa and I had gone out for tapas (much like every other meal we had while in Spain) and although the greasy, bacon-like nuggets of meat were tasty on the way down, I suspect they were partly responsible for the three liquid-sapping trips to the restroom before I set off.  Or maybe it was the instant coffee made with the warmest (definitely not boiling!) water to come out of the hotel-room bathroom faucet.  Certainly not my regular pre-run routine and food, but I figured it was all worth it to be running and racing in a place most Americans don't have the chance to.  

While researching this race, among others, one major difference between European ultras and American ultras emerged:  the European races are "semi-autonomous".  Insofar as I can tell, this simply means that you must carry several mandatory pieces of gear with you --- there are no drop-bags and there are fewer aid stations.  I prefer to run with a hip-pack containing a couple of water bottles but given the number of required items, I instead opted for the Nathan Endurance Vest.  I wasn't 100% sure I'd be able to fit everything in the pack but in the end I prevailed and although moderately heavy when the two-liter bladder was filled to capacity, the pack distributed the weight relatively well and the bounce was minimal.  As for what I schlepped around, some items I would have carried regardless of the requirement --- water, GU, ClifBlocks, TUMS, band aids, and iPhone --- although the other items I may have foregone altogether or placed in a drop bag --- headlamp with spare batteries, thermal blanket, whistle, wind breaker/jacket, and map (provided by the race organizers).  I also had to carry my own cup for use at the aid stations since they did not provide disposable cups and although unlikely any races in the US will adopt this policy in the near future, I think it is a good one (less waste!).
The fire road en route to the first aid station

The course was a point-to-point with the beginning in Rascafria and the finish in Navacerrada, about 30 miles outside of Madrid.  Aside from a short and slight downhill out of Rascafria, the next ten miles were all uphill.  The first six or so miles were on a not-too-steep fire road with good views and when I arrived at the first aid station, I debated whether to refill by water bladder.  Fortunately I did since I wouldn't see another aid station for another ten(!) miles.  The next four miles led us to the summit of Peñalara where the last half-mile or so was less running and more rock scrambling.  It was insane. 
Peñalara straight ahead!
After nearly ten miles of continuous ascent, I was looking forward to the eight mile descent, although my enthusiasm and energy started to flag when I started to feel a bit of nausea (even after a couple of TUMS!) and I wasn't peeing as much as I though I should have.  When I finally arrived at La Granja --- more or less the halfway point --- I desperately needed to rehydrate and eat but the food on offering, aside from the orange wedges, didn't look too appetizing (not because it was a gnarly spread but because I could barely stomach the thought of eating).  After a few water bottles worth of water, a couple of cups of Coke, several orange wedges, and some pasta salad I started to feel better and headed back out.  Lisa was, of course, at the aid station and walked with me for a bit then she bid me well and told me she'd see me six or so miles later at the next aid station.  

I'm not sure if it was the Coke, pasta salad, or the few minutes spent regaining my composure but I felt pretty solid for the stretch to the next aid station (Casa de la Pesca), even if mile 20 felt so long I thought my Garmin was broke and I had to stop to apply a band-aid to my right pinky toe.  The trail leading out of Casa de la Pesca was relatively tame but it soon became brutally steep:  ~1,570 feet of climbing over 2.5 miles.  At one point I was moving so slow it felt like the flies whizzing around my head were simply waiting for me to collapse and keel over so they could feast away.  I was relieved when I finally reached Fuenfria but I still had another ~3 miles before reaching Navacerrada Pass and the long descent to the finish.  As with the other aid stations, Lisa was waiting for me at Navacerrada Pass, walked with me a bit, and --- as always --- had and said what I needed to keep me moving along.  My stomach was bothering me again and just like at La Granja, a couple of cups of Coke made a huge difference.  The last six miles featured some of the best single track I'd run all day as well as some fast fire road and at one point I looked down at my Garmin to see my pace dip below eight minutes per mile.  I could not, unfortunately, maintain that pace and three runners I passed on an earlier downhill overtook me and in the last mile or so, another two runners overtook me.  When I rounded the final corner Lisa was waiting for me and not knowing exactly where the finish line was, she pointed me in the right direction and I lumbered across.  I was the 39th runner to cross the finish line (among 147 finishers) and I did it in 10:15:21.  Although I would have liked to have finished a bit faster, I was still pleased with my run, especially since I was wearing an ominous 666 and passerby would comment (in Spanish) about "El Diablo" or "El Anti-Christo".  I suppose it was fitting it was so hot and I was maintaining a marginal level of hydration:  I can't imagine "el diablo" pees clear, or at all.  I certainly wasn't.   
"El Diablo!  El Diablo!"

Tuesday, June 19, 2012

Inverse Logit --> Logistic Function

The proportional odds/ordinal regression model is slated to figure prominently in my dissertation analysis and since this model is a direct extension of the binary logistic model, I figured (for peace of mind) it would be prudent to review the principles and properties under-girding the logistic model.  Let's start at the beginning.  

Consider a probability, $\pi_i$, that is a function of parameters $\theta = (\alpha \ \beta)^T$ where $\pi_1$ is the probability of disease given an exposure and $\pi_2$ is the probability of disease given no exposure.  Similarly, the complement of $\pi_1$, $(1-\pi_1)$, is the probability of no disease given exposure and $(1-\pi_2)$ is the probability of no disease given no exposure.  Symbolically, we can write:
$\pi_1 = P(D | E), \quad \pi_2 = P(D | \overline{E}), \quad (1-\pi_1) = P(\overline{D} | E), \quad and \quad (1-\pi_2) = P(\overline{D} | \overline{E}).$  
Given this characterization it then follows that if we define $log(\frac{\pi_1}{1-\pi_1}) = \alpha + \beta$ and $log(\frac{\pi_2}{1-\pi_2}) = \alpha$ we can show that the inverse logits are provided by the following logistic functions:  
$\pi_1 = \frac{e^{\alpha + \beta}}{1 + e^{\alpha + \beta}}, \quad (1-\pi_1) = \frac{1}{1 + e^{\alpha + \beta}}, \quad \pi_2 = \frac{e^{\alpha}}{1 + e^{\alpha}}, \quad and \quad (1-\pi_2) = \frac{1}{1 + e^{\alpha}}.$

Each equality is derived below (beginning with logit then proceeding to logistic).  First, consider $\pi_1$:
$[log(\frac{\pi_1}{1-\pi_1}) = \alpha + \beta]exp$
$(\frac{\pi_1}{1 - \pi_1}) = e^{\alpha + \beta}$
$\pi_1 = (e^{\alpha + \beta})(1-\pi_1)$
$\pi_1 = e^{\alpha + \beta} - \pi_1 e^{\alpha + \ beta}$
$\pi_1 + \pi_1 e^{\alpha + \beta} = e^{\alpha + \beta}$
$\pi_1 (1 + e^{\alpha + \beta}) = e^{\alpha + \beta}$
$\pi_1 = \frac{e^{\alpha + \beta}}{1 + e^{\alpha + \beta}}$

Now consider $(1 - \pi_1)$:
$[log(\frac{\pi_1}{1-\pi_1}) = \alpha + \beta]exp$
$(\frac{\pi_1}{1 - \pi_1}) = e^{\alpha + \beta}$
$\pi_1 = (e^{\alpha + \beta})(1-\pi_1)$
$(1 - \pi_1) = \frac{\pi_1}{e^{\alpha + \beta}},$ note that from the previous
$\pi_1 = \frac{e^{\alpha + \beta}}{1 + e^{\alpha + \beta}}$, and when substitute you get
$(1 - \pi_1) = \frac{(\frac{e^{\alpha + \beta}}{1 + e^{\alpha + \beta}})}{e^{\alpha + \beta}}$ 
which then reduces to $(1 - \pi_1) = \frac{1}{1 + e^{\alpha + \beta}}$

Now, $\pi_2$:
$[log(\frac{\pi_2}{1-\pi_2}) = \alpha]exp$
$\frac{\pi_2}{1 - \pi_2} = e^\alpha$
$\pi_2 = e^\alpha - \pi_2 e^\alpha$
$\pi_2 + \pi_2 e^\alpha = e^\alpha$
$\pi_2 (1 + e^\alpha) = e^\alpha$
$\pi_2 = \frac{e^\alpha}{1 + e^\alpha}$

And, lastly, $(1 - \pi_2)$:
$[log(\frac{\pi_2}{1-\pi_2}) = \alpha]exp$
$\frac{\pi_2}{1 - \pi_2} = e^\alpha$
$\pi_2 = e^\alpha (1 - \pi_2)$
$(1 - \pi_2) = \frac{\pi_2}{e^\alpha},$ recall that $\pi_2 = \frac{e^\alpha}{1 + e^\alpha}$ and when we substitute, we get
$(1 - \pi_2) = \frac{(\frac{e^\alpha}{1 + e^\alpha})}{e^\alpha}$ which reduces to 
$(1 - \pi_2) = \frac{1}{1 + e^\alpha}.$

In a forthcoming post, I'll continue with the logistic regression model and present the likelihood as well as the log-likelihood functions and, eventually, the maximum likelihood estimates.  

Friday, June 15, 2012

Romney Gaffes: Oops, did I just say what I really think?

Photograph: Win Mcnamee/Getty Images
Politicians tend to be a disingenuous bunch.  They pander, flatter, distort, and sometimes outright lie just to get elected.  Democrats do it; Republicans do it.  But the extent to which Romney does it is beyond anything I remember in recent memory.  I'm creating this post (and will update it as necessary) to chronicle what seems to be a constant stream of comments, answers to questions, too candid remarks, and otherwise idiotic things he has said that betray what he really thinks and how he really feels (in no particular order). 
  • "He [Obama] wants another stimulus, he wants to hire more government workers.  He says we need more fireman, more policemen, more teachers.  Did he not get the message of Wisconsin?  The American people did.  It's time for us to cut back on government and help the American people."  --- A Romney speech opposing more stimulus to hire more government workers.  It's one thing to rail against the faceless, nameless government bureaucrat but something else to actually name those good-for-nothin' parasitical government workers. (June 2012)
  • "I like being able to fire people who provide services to me."  --- As if that isn't obvious based on his distinguished record at Bain Capital.  This was, to put it mildly, Romney's unfortunate choice of words while advocating for consumer choice in health insurance plans (January 2012)
  • "[My wife] drives a couple of Cadillacs." --- As if everyone has two cars at their disposal!  I get that the Romney clan maintains separate residences so having two cars is reasonable but the casual nature of his remark suggests he is completely out of touch with the 'ordinary' American.  Romney said this while out campaigning for president in Michigan (February 2012)
  • "I get speaker's fees from time to time, but not very much." --- Romney's version of "not very much" is, I suppose, consistent with his wealth but comically at odds with the "not very much" most Americans envision.  This quote is in reference to the $374,000 he earned in speaking fees in one year according to his personal financial disclosure (January 2012)
  • "I believe in an America where millions of Americans believe in an America that's the America millions of Americans believe in. That's the America I love." --- Is Romney channeling Palin here? (January 2012)
  • "I love this state. The trees are the right height." --- You seriously can't think of anything else good to say about a state aside from the height of the trees?  Which states does he hate based on the (wrong) height of their trees?  He said this while campaigning in Michigan.  (February 2012)
  • "I have some friends who are NASCAR team owners." --- Again, props for his honesty here.  He desperately needs to woo the Nascar-loving segment of the electorate but, instead, he comments on how chummy he is with the team owners. (February 2012)
  • "I like those fancy raincoats you bought. Really sprung for the big bucks." --- Oh, Christ.  I thing he's trying to be funny here but there is nothing amusing about making people feel self-conscious.  He said this while addressing a group of NASCAR fans wearing plastic ponchos at the Daytona 500. (February 2012)
  • "Corporations are people, my friend… of course they are. Everything corporations earn ultimately goes to the people. Where do you think it goes? Whose pockets? Whose pockets? People's pockets. Human beings, my friend." --- You'd think given Romney's education pedigree (MBA and law degrees both from Harvard!) he would know the definition of a corporation.  Per the Legal Dictionary, a corporation is "an organization formed with state governmental approval to act as an artificial person to carry on business (or other activities), which can sue or be sued, and (unless it is non-profit) can issue shares of stock to raise funds with which to start a business or increase its capital."  This comment was in response to a heckler at the Iowa State Fair who had the audacity to suggest that higher taxes should be considered as part of a balanced budget.  (August 2011)
  • "But he [Obama] spent too much time at Harvard" --- This comment might have more traction if Romney hadn't spent more time at Harvard than Obama.  Romney earned both an MBA and JD during four years at Harvard whereas Obama earned just a JD (three years).  So if Obama spent too much time at Harvard and Romney spent even more time there than Obama did, what does that make Romney?  (April 2012)
  • "My own view, by the way, was that the auto companies needed to go through bankruptcy before government help. And frankly, that’s finally what the president did. He finally took them through bankruptcy. That was the right course I argued for from the very beginning. It was the UAW and the president that delayed the idea of bankruptcy. I pushed the idea of a managed bankruptcy and finally when that was done, and help was given, the companies got back on their feet. So I’ll take a lot of credit for the fact that this industry’s come back." --- Umm, no, you can't take credit for the auto bailout, Mr. Romney, unless credit means talking out your ass both before and after the auto-bailout.  Too bad for you the internet makes it a bit more difficult to revise history these days (May 2012)
  • "We're only inches away from no longer being a free economy."  --- Romney's claim (for the third time!) that government spending has become so high the United States is at risk of becoming a socialist state (January 2012).  PolitiFact marshals evidence to show that this comment is a boldface lie (and using estimates from a conservative think tank, no less!).  US government spending as a percentage of GDP has remained relatively stable since 1996 although there was an uptick in 2009-10 due to increased government spending after the global financial crisis.  Also, taxes and regulation in the US are comparatively low when considered alongside other industrialized nations.  
  • “You’ll see my income, how much taxes I’ve paid, how much I’ve paid to charity, I pay all the taxes that are legally required and not a dollar more. I don’t think you want someone as the candidate for president who pays more taxes than he owes.”  --- Romney's effective tax rate in 2010 was 13.9%, a rate considerably lower than most middle-class and well-to-do Americans pay.  To be fair, Romney's tax bill in an absolute sense was a lot -- $6.2 million to the federal government -- but as a percentage it was lower than the rates paid by Obama and Gingrich.  No rational person is going to volunteer to pay more taxes than he/she owes but what Romney fails to recognize (or appreciate?) is this:  he benefited magnificently from the infrastructure, laws, and business environment our government/country nurtured but then refuses to fully acknowledge the role government played in his financial success.  Sorry, Mr. Romney, but no one -- not even you -- can claim they "made it" by their efforts and their efforts alone.  Yes, you are a smart, ambitious, resourceful, hard-working man but government cultivated an environment in which you could succeed.  (January 2012)
Updated 06/18/2012:
  • "Well, we’ll go through that process with Congress as to which of all the different deductions and the exemptions —" --- Romney in response to a question posed by Bob Schieffer asking about how Romney would generate revenue by cutting taxes.  Mr. Schieffer's question was, "You haven't been bashful about telling us you want to cut taxes.  When are you going to tell us where you're going to get the revenue?  Which of the deductions are you going to eliminate?  Which of the tax credits are you going to -- when are you going to be able to tell us that?"  Since the economy and jobs are the cornerstone of Romney's platform you'd think he would have more specifics in mind.  Perhaps he does but he is remaining coy until his campaign can repackage and spin them such that they won't seem as objectionable to the average American?   
Updated 08/01/2012 (this isn't so much as a gaffe as an idiotic response to a reasonable question):
  • "I tend to tell people what I actually believe, and referring to the comments that were made in the media was something which I felt was an honest reflection of what was being concerned, what was concerning folks and having had the experience I'm absolutely convinced the organizing committee did what people hoped which is overcome the challenges and produced a brilliant product."  This long-winded, Palin-esque reply was in response to a question from ABC News' David Muir re: Romney's comments about the London Olympics.  This statement is ridiculous on so many levels, not least of which is his claim that he tends "to tell people what I actually believe."  Well, Mr. Romney, you better be babbling at the mouth non-stop because what you believe seems to change much too frequently. 
Updated 09/18/2012 (this isn't really a gaffe since Romney was being remarkably candid during a private fundraiser about the 'moochers' of American society paying no income tax) :
  • "There are 47 percent of the people who will vote for the president no matter what. All right, there are 47 percent who are with him, who are dependent upon government, who believe that they are victims, who believe the government has a responsibility to care for them, who believe that they are entitled to health care, to food, to housing, to you-name-it. That that's an entitlement. And the government should give it to them. And they will vote for this president no matter what…These are people who pay no income tax."  His disdain for the American common man is astonishing. 
Updated 09/27/2012.  Maybe it's the grueling travel schedule, or maybe it's the fact that he's been campaigning for so long that he's lost touch with reality.  Either way, this is awesome:
  • "When you have a fire in an aircraft, there’s no place to go, exactly, there’s no — and you can’t find any oxygen from outside the aircraft to get in the aircraft, because the windows don’t open. I don’t know why they don’t do that. It’s a real problem."  Romney commenting on the smoke-filled airplane his wife was flying on and how the windows don't open.  Pressurized cabin, Mitt?

Wednesday, June 13, 2012

Concordance, Correlation, Agreement -- Plots

Stata Command
Frequency Table Plot
Created by the prolific Nicholas Cox (Durham University, UK), this command “plots a table of frequencies, fractions or percents in graphical form” (Stata help file).  Well over a dozen options exist to sex up the plots.  A handy graphic to visually assess concordance between two categorical variables. 
(Cumulative) Distribution Plot
Also authored by Nick Cox, these plots chart the cumulative distribution of one or more variables.  Although the two plots are subtly different, they essentially produce plots of cumulative distributions as the proportion or frequency ≤ to each value.  The first command, -distplot-, appears to be a succession of the latter command, -ordplot-, although –ordplot- explicitly specifies that the variable be ordinal.  
Paired Observation Plot
Again, credit goes to Nick Cox.  This plot is ideally suited for paired data sharing a time component (e.g. before/after).  The barebones command requires two y-variables where the difference or ratio between the two is plotted on the y-axis and the observation number on the x-axis.  Helpful for visualizing change between two finite points by subject.
Two-dimensional Biplot
This official Stata command plots the relationship between observations and variables.  The graph returned plots the observations as points and the relative position of the variables as arrows.  This command seems helpful in visualizing where observations and variables cluster as well as correlation between the variables.
Bland-Altman Plot
First published by Bland and Altman in 1983, this graph assesses measure of agreement between two variables.  The authors used continuous variables in their paper but note that categorical variables can also be analyzed.  The plot is intended as a replacement to using the correlation coefficient to assess agreement.  The graph plots the difference of two (paired) variables versus their average and state that with this plot “it is much easier to assess the magnitude of disagreement (both error and bias), spot outliers, and see whether there is any trend” (Altman & Bland, 1983).  Another Brit, Paul Seed, wrote the Stata programs for these plots. 

Although I'm no longer planning to use any of these concordance plots or tests for my dissertation, I figured I'd post them anyway since I went to the trouble of jotting them down on my whiteboard.  (I also need the whiteboard space and wanted to move the information online before unceremoniously erasing my table.) 

This isn't intended to be an exhaustive list of all the tests and techniques for assessing concordance but I think I managed to get a fair number of them.  If nothing else, this can be used as a good jumping off point for further research.

Friday, June 1, 2012

Evolution and Origin of AIDS

I just finished reading Jacques Pepin's highly-researched "The Origins of AIDS".  Any claim that this book isn't grounded on solid scholarship would be utterly baseless.  Dr. Pepin clearly has a handle on what's been written about the origins of AIDS and has managed to collate all(?) of the material published, synthesized the prevailing theories, marshaled what data still exists, and where gaps remain, he makes reasonable conjectures.  The length of the book is fairly modest but the material and its presentation are dense.  Dr. Pepin clearly isn't a journalist so don't expect this book to read like a NY Times Magazine article:  he is a clinician and an academic so expect the book to read and flow like a journal article. 

Given the density of the information in the book --- this topic is naturally complicated --- I wanted to distill it down to (what I consider) the essentials.  So I made a picture.  (I also figure this will help improve my long-term memory retention.)   

Disclaimer:  My rendition of the origins of AIDS, although based solely on Dr. Pepin's work, in no way reflects the depth of his scholarship since I had to take some liberties with respect to what I'd include.  There was only so much white-space available. 
Graphic created by cjt using information adapted from "The Origins of AIDS" (Jacques Pepin)