Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Wednesday, January 7, 2009

R in the NY Times

I've detailed, R, that wonderful piece of statistical software in a previous post, but an article in today's NY Times gives some nice additional background to the whole project. Check it out if you want to know "the rest of the story." There's also a delightfully snarky quote from a spokesperson for SAS, the chief commercial rival to R.
“I think it addresses a niche market for high-end data analysts that want free, readily available code," said Anne H. Milley, director of technology product marketing at SAS. She adds, “We have customers who build engines for aircraft. I am happy they are not using freeware when I get on a jet.”
Because everyone knows that commercial software is always reliable. Personally, I don't care what software an engineer uses to design a jet. Just as long as the software and the engineer both know what they're doing. The same goes for the software (a mix of commercial, open source, and free closed-source programs) I use in my own research--I'm not a complete open source zealot (all my FEA analyses are on commercial software, because I still haven't found an open source alternative that doesn't require a computer science degree), but if I can get the job done for free, the price is right!

Thanks to Denim and Tweed for pointing me towards this link.

Wednesday, October 8, 2008

Head Butting Goats: Part I

This post is slowly getting written. . .SVP talk preparation and other commitments take away blogging time! Anyhow, here's part I. . .

Farke, A. A. 2008. Frontal sinuses and head butting in goats: a finite element analysis. Journal of Experimental Biology 211: 3085-3094. doi: 10.1242/jeb.019042

To get a PDF of this paper, try this link first. If it doesn't work, email me at andyfarke [at] hotmail [dot] com, and I'll send you a (legal) link for a free download.

You're a Paleontologist - Why Head Butting in Goats?
This paper is all about the dinosaurs, really! Years ago (when I was in high school, in fact, back in 1996), I read an article by Cathy Forster on skull anatomy in the horned dinosaur Triceratops. She speculated on the function of these sinuses (hollow spaces above the brain and below the horns), noting some similarities with horned mammals such as bighorn sheep. Sheep and many of their relatives also have these massive sinuses in their skulls (see image at left) - some researchers posit that the sinuses serve as shock absorbers. The sinuses then protect the brain from being rattled around during horn-to-horn combat. Cathy (and others) thus inferred that because sheep have sinuses, and the sinuses are shock absorbers in these animals, then the sinuses of Triceratops are also probably related to shock absorption. Cool idea, huh?

But, I noted one problem: nobody has ever demonstrated that the sinuses of sheep, goats, and their relatives actually act as shock absorbers! It's one of these nice "truths" that remained untried. So, I decided to test this as one small part of my dissertation work on skull function in horned dinosaurs.

Methods to the Madness
How do you investigate head butting in a living animal? One path is to wire up the bone of the skull with strain gages, which measure the deformation of the bone during an activity. This didn't appeal to me for a few reasons: 1) It would be messy and invasive in living animals; 2) it would be just plain messy in dead animals; and 3) there was really no good way to experimentally manipulate the skull anatomy to test the effect of adding or removing sinuses. In all seriousness, it was point 3 that proved the most problematic.

The solution: computer modeling. Specifically, I used a technique called finite element analysis, or FEA for short. In brief, FEA allows you to model the physical "behavior" of a complexly-shaped structure under given conditions. For this study, it was a goat head under a load to the horns. So, what's so good about a computer analysis, over a "real-world" experimental approach? Most importantly, I could really, truly manipulate the skull anatomy. In order to measure the effect of sinuses, I made goat skulls with big sinuses. Goat skulls with small sinuses. Goat skulls with no sinuses at all. You just can't do this in real life!

I chose goats rather than other horned mammals because they were cheap, easily accessible, and a well-studied lab animal already. An archaeologist colleague got me a fresh goat head, which I then CT scanned. From the CT scan, I developed a 3D model of the skull itself. This skull was then imported into commercial FEA software (Algor FEMpro). Finally, I told the software to "pretend" that the goat's horns were being loaded in various directions, to simulate the forces of head butting. I hit the "analyze" button, and waited the half hour or so for the results. . .

Remember, now, that I made models of goat heads with and without sinuses (see the image below left for external views of two of these models, modified from a figure in the original paper; you can't see the sinus region here). If sinuses truly protect the brain, I would expect 1) that strains in the bone surrounding the brain should be greatly reduced for models with sinuses; and 2) lots of energy should be absorbed in the walls of the sinuses before reaching the brain.

What did I find? Stay tuned for the thrilling sequel to this post!

Tuesday, March 4, 2008

R for Paleontologists

Quite by accident, while searching for the answer to another question I had about R (a powerful open source statistical language), I ran across a nice set of PDFs from a short course called, "Data Analysis in Paleontology for R." Gene Hunt, curator of Ostracoda at the Smithsonian, ran this nearly two years ago. The PDFs contain slides on topics ranging from the basics of loading data to running a PCA or correcting for phylogeny. As an added bonus, each includes some short exercises to practice your new-found skills. Click this text to follow the link, and then look under "Resources." The slides are posted as five separate PDFs.

I have now switched to R for nearly all of my statistical analysis needs, and have been immensely satisfied so far. Expect a post on this sometime in the next few weeks (hopefully).