## Comparison of means: the t test

A t test is used to compare the means of two data sets, and it relies on calculation of a test statistic called t. This statistic is derived from the two data sets and it is defined as the difference between the means of the two data sets, x̅1 and x̅2 (or the difference between a mean x̅ and …

## Comparison of variances: the F test

An F test is used to compare the variances of two data sets: As it is used to compare variances, the dependent data must – by definition – be numeric. As it is used to compare two distinct sets of data, these sets represent the two levels of a factor. The test statistic we use …

## Organism of the week #19 – Bird-brained humans

Most people who want to attract birds to their gardens put out bird-seed, or – if they’re really adventurous – mealworms. However, on the East London dockside where I lived until recently, one of the residents strewed the quayside with livers in December last year. Was this was a deliberate ploy to attract carrion crows for bird-on-variety-meat …

## Descriptive statistics

Statistics can be used to describe a data set, or they can be used to infer how well a model fits a data set. In this post, we’ll look the the former kind of statistics, and how to extract them from R. The remaining posts in this series will mostly deal with statistical tests and …

## Organism of the week #18 – Feeling rotten

It’s been ages since I did one of these, and today’s will not be terribly long or exciting, for the reason that is the very title of this post. Whilst bumbling around in the fridge looking for something bland and bowel-friendly, I chanced upon a lemon that had fallen into a oubliette in the bottom …

## Plotting data

You can plot data using plot(). This can be used in several ways. The simplest is to plot some numeric x-values against some numeric y-values using: plot( x.variable.vector, y.variable.vector ) For example: x<-c( 1:10 ) y<-1 + 2*x plot( x, y ) However, for data you have imported into a data frame, the x and …

## Formatting data

Although you will occasionally type data directly into R, more often than not, you will have a spread-sheet containing data which you want to import. R can easily import data from a comma-separated variable (CSV) file. If you open a CSV file using a text-editor, you will see that they look something like this inside …

## Kinds of data

The sort of data you want to analyse in R may come in many forms. You will often be trying to model the interaction of some independent variables (a.k.a. input, predictor or explanatory variables, the things you’d plot on an x axis) to explain the values of some dependent variable (a.k.a. output, outcome or response variable, …

## Running R code

The R interpreter is controlled by typing in plain-text commands at its command-line prompt >|. R commands are just text, so you can prepare a chunk of them in a text-editor, and then copy-and-paste them directly into R to run them immediately. Try copying and pasting the line below at the prompt: print(“Hello world”) Lo …

## Teardrops of the swan

Last year, the most marvellous thing we saw in the pond-water microscopy practical was a ciliate, and this year the prize goes to that same clade. Ciliates don’t disappoint. This is Lacrymaria olor, the “teardrop of the swan”. It’s a predator, like the Vorticella from last year, but rather than sitting rooted to the spot, Lacrymaria is …