How bad is the math?

Most of it is downright awful.  That's why we will be using "R."  

My ability with arithmetic is notoriously bad.  On my first date I left a chintzy 5% tip because I did the arithmetic wrong... Let's see... knock off the last digit, take half of that, and then add.  Except I forgot to add back the 10%, so voila, a 5% tip!  If you expect me to add, subtract, divide, or multiply on the spot you will be bitterly disappointed.  It is a frightening thought that I was the secretary-treasurer of the AAPA for four years, but that is what spreadsheets and Quicken are for.

And my training in mathematics has been quite rudimentary.  I had a semester of probability theory as a freshman in college, a semester of statistics, and a semester of "calculus for those who don't really want to take calculus but have to anyhow" (the official title was "A Brief Survey of Calculus").  In graduate school  I took a year's worth of statistics through the anthropology department.  But even so, it was not until I did a postdoc in a genetics department that I became more than passingly familiar with maximum likelihood estimation.


Now, on to the "goods" :

  1. Download "stuff" - For this workshop we will be using "R" and "OpenBUGS."  And when I say "we" I mean it.  You will want to download these packages so that we can work through material at the workshop.
  2. A handy-dandy couple of pages about R.
  3. List of "R" packages you will need to download and why we need 'em.  See "download stuff" above which shows you how to download and install packages within R.  It is very easy to do.
  4. Perinates - We will start out looking at perinatal age estimation using long bone lengths.  The advantage of starting here is that we can use familiar regression models (of long bone length on age) and that we can go multivariate by using multiple bones.
  5. Latent traits - A lot of age estimation is based on ordinal categorical data, so we definitely need to look at how to analyze this kind of data.  There are various methods that can be used for latent trait analysis, with probit regression being one of the more common.  If you are familiar with "transition analysis," then probit regression is one of the ways to do transition analysis.
     and besides, "latent traits" rhymes with "perinates"

Q&A:


Q: When I enter the following at the R prompt > refbones=read.csv('refbones.csv') I  get back the following:

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
 cannot open file 'refbones.csv': No such file or directory

A: This is because the file 'refbones.csv' is not in the same directory as your R workspace.   The first time you run R you will (likely) do so by double clicking the program's icon.  And typically that means that your workspace is on the "desktop" because that's (typically) where the program's icon is located.  So what you could do is open R and then exit without doing anything.  That will write the file .Rdata to your desktop.  Then drag that file to the directory where you have the file "refbones.csv."  Now double click that .Rdata file and R will open it.  When you type  refbones=read.csv('refbones.csv') now R will find the *.csv file.  Note: if you got everything using the *.zip file listed above, I already put a blank R workspace in there.  So just click on it and you are good to go.

Q: Once I've input the OpenBUGS model and checked it, how do I generate all the pretty pictures?

A: The interface is a bit tricky to use the first few times, which is why you may want to hold off doing this until we are gathered in Oxford.  But here's a "teaser:"

There's a movie for WinBUGS at http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/winbugsthemovie.swf that might be helpful.  WinBUGS is the predecessor to OpenBUGS and the user interface is, so far as I can tell, no different.  You will find some differences though in how to run the first analysis, because the first time we'll use it in the workshop there is no data (actually, there is data but it is just: y <- 60 and is in the model).  You also will not need to load any initial values.  So the steps are:

\model\specification from pull-down menu
1) highlight "model" and hit the "check model" button -> "model is syntactically correct" appears in tiny, tiny print in the bottom left of the window
2.) compile -> "model compiled"
3) gen inits >- "initial values generated, model initialized"

\inference\samples from pull-down menu
At "node" type "x" without quotes and hit the "set" button

\model\update from pull-down menu
click "update" button

go back to the "Sample Monitor Tool" that you pulled up with \inference\samples
click on the "density," "auto cor," and "stats" buttons.

Q: You sure about the degrees of freedom for the residual variance-covariance matrix?  Is it really n -2 ?

A: Er, I'm pretty sure that I have entered the wrong degrees of freedom in a number of places.  It should be n - 2 - q where q is the number of dependent variables.