Posts filed under 'statistics'

drawings

I have always been of the opinion that math cannot be taught without a blackboard. Or a whiteboard - it’s not the color I’m talking about. But slides or powerpoints etc. just do not really do the job. Students can see the results of your descriptions, but not the action - you need to see math happening to get it, usually. And you also need to be able to answer questions that come up.

My statistics teaching takes place in a computer lab, since I combine lectures and tutorials in one. In the lab, there is a projector for the PC, but only one tiny whiteboard, stuck in the corner of the room. Of no use, really. So I’m searching for solutions.

Last night I watched a - for absolute nerds like me very interesting - lecture by Donald Knuth on “platology” (you can find it on iTunes U, which is a brilliant facility anyway). In the lecture, he has a camera on his paper in front of him, so he just writes with pen on paper and gets it projected on a screen. That’s pretty nice. But it of course requires technology not currently in the computer lab.

So now I wonder whether a site I stumbled on just now, Dabbleboard, is the solution. It seems like a very nice tool to use the normal projector to draw things and explain. It helps with the issue of not being able to draw straight lines with a mouse. It bags for a proper digital pen, though. In any case, I think it is a cool site, and it also allows for collaboration, so it makes discussions easier when you’re trying to discuss mathematical things on MSN or Skype.

Other suggestions are definitely welcome (just email me, as comments on the blog have been disabled). I found the page through DemoGirl.com, which is quite interesting as well.

Add comment August 18th, 2008

squash

Ok, from now on I’m going to keep score properly:

Overall:

name won lost
Jos 0 22
Leonardo 23 1
Rory 8 7
Shane 5 7

Competition:

Leonardo Shane Rory Jos
Leonardo 0 % (0-5) 17 % (1-5) 0 % (0-13)
Shane 100 % (5-0) 33 % (1-2) 0 % (0-3)
Rory 83 % (5-1) 67 % (2-1) 0 % (0-6)
Jos 100 % (13-0) 100 % (3-0) 100 % (6-0)

Games:

03/12/2007 Leonardo - Jos 7 - 0
12/12/2007 Leonardo - Shane 3 - 0
18/12/2007 Leonardo - Rory 4 - 0 (9-5 9-5 9-2 9-0)
Leonardo - Jos 4 - 0 (9-1 9-1 9-5 9-1)
Rory - Jos 4 - 0 (9-1 9-1 9-3 9-8)
07/01/2008 see photos
Shane - Jos 3 - 0 (9-4 9-1 9-0)
Leonardo - Shane 2 - 0 (9-3 10-8)
Leonardo - Rory 1 - 1 (9-7 1-9)
Shane - Rory 2 - 1 (9-0 11-9 4-9)
Leonardo - Jos 2 - 0 (9-0 9-5)
Rory - Jos 2 - 0 (9-5 9-1)

1 comment December 3rd, 2007

probability talk

Here’s an interesting short talk by Peter Donnelly about probability theory and how it affects important decisions being made. Interesting examples with regards to testing for rare diseases (i.e. if you ever get tested positive for HIV, you should probably immediately start taking drugs, but also get another test!) or a murder trial conviction based on incorrect probability theory (and an error of logic).

Add comment November 7th, 2007

talking R

Based on this post in Andrew Gelman’s blog, which I read religiously, I wrote a little R template for the bootstrap procedure. Well, the template is simple, but the cool thing is that it tells you when it is finished, so you can stop going back and forth to the R window to check whether it’s done. This one is fast, but for a long, slow procedure, that’s pretty cool. Alas, only works on a Mac (and perhaps Linux?).

x <- rnorm(100,3,2)

bs <- NULL
for (i in 1:1000)
{
bs.sample <- sample(x, length(x), replace=T)
bs[i] <- mean(bs.sample)
}
system(sprintf("say The bootstrap has finished. The result is a mean of %4.2f, with standard error %4.2f. You can access the result with the b s variable.", mean(bs), sd(bs)))

Add comment October 28th, 2007

r tutorial

This video tutorial is an interesting way to get a basic idea of how the statistical package R, which I use for teaching statistics, works.

Add comment October 10th, 2007

first class in econometrics

A very useful article, published in a peer-reviewed journal, hence true science: A first lesson in econometrics.

Add comment September 5th, 2007

laffer curve

I guess I’ll be a successful lecturer in research methods if I can get my students not to do this!

Add comment July 17th, 2007

merging in R on name

Often people want to merge datasets and have names of countries or locations that they want to merge on. These names are often somewhat similar, but not exactly. A function in R that is hugely useful to merge in this case is called agrep. With this function you can do approximate matching of names (or rather, or strings as subset of other strings). To merge properly, though, you do want to avoid matching the same name twice and you want to prioritize exact matches over very fuzzy matches. The idea is not mine, but Eduardo’s. To do so, I wrote a little R function, which is here in beta version:

agrep.wrapper < - function(x, y, names.x = "name", names.y = "name", ids.x = "id", ignore.case=TRUE, max.threshold=1) {

    x <- as.data.frame(x, stringsAsFactors=FALSE)
    y <- as.data.frame(y, stringsAsFactors=FALSE)

    unique.x.select <- !duplicated(x[,ids.x])
    unique.x.names <- x[,names.x][unique.x.select]
    unique.x.ids <- x[,ids.x][unique.x.select]
    
    unique.y.select <- !duplicated(y[,names.y])
    unique.y.names <- y[,names.y][unique.y.select]
    unique.y.ids <- rep(NA,length(unique.y.names))
    
    matching.x.names <- unique.x.names
    matching.x.ids <- unique.x.ids
    
    for (threshold in seq(from=0, to=max.threshold, by=.1)) {
        
        i <- 1
        while (i <= length(matching.x.names)) {
            
            select <- (1:length(unique.y.ids) %in% agrep(matching.x.names[i], unique.y.names, ignore.case=ignore.case, max.distance=threshold)) & is.na(unique.y.ids)
                
            if (sum(select) > 0) {
            
                unique.y.ids[select] <- matching.x.ids[i]
                matching.x.ids <- matching.x.ids[-i]
                matching.x.names <- matching.x.names[-i]
            } else
                i <- i + 1
        }
    }
            
    unique.data <- merge(data.frame(unique.x.names, unique.x.ids), data.frame(unique.y.names, unique.y.ids), by.x=”unique.x.ids”, by.y=”unique.y.ids”, all=TRUE)
    
    list(matches = unique.data)
}

Add comment March 8th, 2007


Calendar

September 2008
M T W T F S S
« Aug    
1234567
891011121314
15161718192021
22232425262728
2930  

Posts by Month

Posts by Category