It may have been a while since you last learned about statistics. Statistical software now makes running the calculations themselves very easy. Although using R may seem rather challenging at first, it is really much faster to use R than to carry out statistics “by hand” or using non dedicated software such as Excel However the problem with using R for statistics is that many students concentrate attention on learning to use the software rather then remembering the concepts. In this class we will refresh the most basic ideas in statistics without using any software. We will then see how to use R to make life easier.
Let’s look at the reaction times on a simple test for the students in the class. Click on the link below. Run the test. After a “burn in” period to get used to the idea, record your own time in ten trials.
Ok we now have some data from the class. We will now go a step further.
These are basic descriptive statistics.
This part of the exercise is more subtle. We will spend a lot of time during the classes discussing the nature of statistical inference and the importance of testing assumptions. For the moment, let’s just do the maths.
Just out of interest You don’t have to follow this yet, the follwing R code does this operation “by hand”
data<- c(440,340,350,456,470) ## Five observations of reaction time
x<-data-mean(data) # Subtract the mean from the data
x<-x^2 # Square the results
x<-sum(x)/4 # Divide by n.1
sqrt(x) # Take the square root
## [1] 61.45893
And again, just out of interest, statistical software does all this (and a lot more) with a simple function.
sd(data)
## [1] 61.45893
The standard errror of the mean is the standard deviation divided by the square root of the sample size. The 95% confidence interval for the mean is approximately two times the standard error.
There is a lot to discuss here. We will look at the nature of inferential statistics in more detail as we go on. Practice calcualting standard deviations and standard errors “by hand” in order to get a feel for the process. Once you understand the calculations you can leave the rest to the computer. However you will have to understand the assumptions involved in calculating a standard error in order to apply statistics correctly. We will go thought this carefully later.