Sunday, February 16, 2014

ANOVA with SPSS: quick tutorial

I've recently had to do quite a bit of statistics for my project in school and I ended up having to learn it with a new software for compatibility with what my professor uses, which is SPSS. It's probably a good statistical package to learn since it's one of the most popular ones around the world. Since I had no idea how to do anything on it before this, I had to do a bit of reading and thought there would be some value in posting a quick step by step guide on how to run a one-way anova test using SPSS.

For completness, I'm using IBM SPSS Statistics 22. So load up your SPSS (which is shockingly bulky imho). I imagine that if you are reading this post you know what an ANOVA is but in case you don't, ANOVA stands for ANalysis Of VAriance. If you are familiar with the student's t-test, an ANOVA is similar to that. However, while a t-test compares the means of two groups, an ANOVA compares the means of several groups. It looks across all your data and spits out a number (F) which tells you how significant the variance is across all your groups. This will tell you whether there is an overall effect after looking at all your data. A One-Way ANOVA does just that, and it looks specifically across one factor such as different treatment groups. If you hear about a Two-Way ANOVA, that's when you have multiple factors to be compared, for instance you may have different treatment groups in a drug study, but you may also want to look at how those treatment groups change over time, say the course of a month. Then you need to look at changes between groups, (does drug X make animals sick?) as well as within groups (do animals taking drug X become resistant to the drug over a period of time?). Lastly, from an ANOVA, you can also do a Post Hoc comparisson, which is essentially a t-test across all your groups. If you have an overall effect from your ANOVA (F > critical value) then you compare each group to see if they have p < 0.05 for significance. In my example I will use the Bonferroni test which is a more conservative one. There are other popular options such as the less conservative LSD, as well as Tukey's and Dunnett's test.


Open your data or enter your data, for me I had everything in excel before, so it was just a matter of copying and pasting everything. However, in SPSS, as you may or may not know, you can also assign your groups as a different type of data. On the bottom there are two tabs, to work on your groups click on "Variable View". There you will see all your variables, and in my case I eddited the varialbe "Group" by pressing on the cell under "Values".


There you should label each numeric value that represents one of your groups to a label that makes sense to you. Click OK and go back to the original tab, "Data View".


 Now to actually run the test, first find out what columns of data you are actually going to analyze. The sheet I'm using as an example contains all my data from one of my taste reactivity experiments, and includes a lot of behavioural data I have no interest in running stats on. For this example I am interested in running a one-way ANOVA comparing across all my treatment groups, however only testing the total number of gaping reactions.

To do that, find in the menu the option "Analyze" > "Compare Means" > "One-Way ANOVA..."

That should lead you to a smaller pop-up window where you will put your treatment group column under "Factor" and place the data you want analyzed under "Dependent List" which corresponds to your dependent variables. From there click on "Post Hoc..."


There you can chose what type of Post Hoc comparisson you want to make, in my case I am doing a Bonferroni test.


Now, still in the  ANOVA screen, go to "Options..." and click "Descriptive" which I believe will provide you with some of the basic statistical values for your data such as means, standard deviation, standard error and so forth.

From there click continue and OK to run your test. Voila, you should see a report page. On the top you will find your descriptives separated by your groups. N will be the total number of individuals in your groups, your mean, SEM, etc. Below will be your general ANOVA results, which will give you your degrees of freedom, your F value and your significance value. My degrees of freedom are 5 and 50, as you sometimes see them represented as F(5,50), and my F which is 5.475. This is sufficient for me to claim significance in my data, notice the .000 value under significance as well which is similar to a p-value that you are used to.

Below you will find your Post Hoc Tests, in my case Bonferroni. Each row block will have all your comparissons between one group to all the other groups. See in my figure below a comparisson between my Saline group to all other groups. Notice that the only significant difference lies between group Lor6 and my vehicle group. It has a * next to it and you will notice that significance is 0.002, which is >0.05.


No comments:

Post a Comment