## Statistics 200: Lab 11-13 (Friday 15 & 22 November, 6 December)

Today's tasks: Now you get a chance to show what you have learned, by using Splus to do something useful.

For the next two lab sessions you should work on a project involving Splus. During the final lab session, on Friday 6 December, you will get to explain to the class what you have done. You need to get started quickly.

### Some possible projects

• Some of you already have data sets that you want to work with. Try to use the graphics tools in Splus to show what you have, and what sort of analysis might be possible.
• Get hold of some data from the recent election. Try to show patterns across Connecticut, national patterns, contrasts with polling information, or whatever. My wife found a table giving presidential votes by town within Connecticut at polltrak, but it would take a little bit of work to convert it to a convenient form. Maybe you could make use of Census data. Maybe you can do something with the exit-poll data. The index might be a good place to start looking.
• Write a useful Splus function. For example, it would be nice to have a modified version of read.table() that didn't suffer from the overhead of writing large temporary files to extract headers. I think it can be done using scan() more efficiently. I would like to have a function like:
```my.read.table(filename,sep,header=T,datatypes)
```
that would return a data frame. For example, if a file foobar.txt contained
```court:date:disq:count
H12W:960503:OK:77
HHD:960219:06:45
```
and so on, then I would like
```junk <- my.read.table("foobar.txt",sep=":",datatypes="FCFN")
```
to return a data frame with factor variables junk\$court and junk\$disq, a character variable junk\$date, and a numeric variable junk\$count. If you want to get fancy you might allow more flexible forms for the datatypes.
• For folks in the Linear Models course, we would accept a combined project if it contained enough material. For example, you might be able to develop some functions to bootstrap regression residuals and produce some interesting graphical displays. Talk to Marten about this one.
• Find an example where trellis graphics is really a big improvement over the simpler Splus tools. Create some deviishly clever panel functions.