915
edits
Changes
m
coming later...
re-worded several sentences
[[Category:Statistics]]
[[Category:Math]]
[[Category:R]]
This is based on using either Excel or R for the analysis. To get data into R, the easiest way is to make the data in excel then import it into R with this command:
<pre>=TTEST(GROUPRANGE1, GROUPRANGE2, 2 ,3)</pre>
* Using R (for more details see http://www.statmethods.net/stats/ttest.html and http://stat.ethz.ch/R-manual/R-patched/library/stats/html/t.test.html):
If you have to lists of numbers, not in a table then you can test them directly:
<pre>
ttest(group1, group2) #this compares two arrays of numbers
</pre>
If you have a table, named '''dataset''' with columns names '''values''' and '''group'''. The '''group''' column contains 2 different values (for example WT and KO). If you have more than 2 values in the group then you need to go to [[#If you are testing one variable with more than two groups(One Way ANOVA)]].
<pre>
ttest(values ~ group) #this compares the values column if there are two different variables in the group column. It will not work if there are more than 2 groups
</pre>
==Multiple Comparisons==
===If you are testing one variable with more than one value two groups(One Way ANOVA)===
Not if you are comparing 2 groups to control, but if you are comparing three groups internally. For example this might be Normal Diet, High Fat Diet, High Protein Diet. Note that if you do this with just two groups, the result should be the same as a t-test.
* Using R, providing data is formatted in a dataframe named '''dataset''' with columns '''group''' and '''values''' (see http://stat.ethz.ch/R-manual/R-patched/library/stats/html/aov.html). The first step is to do an [http://en.wikipedia.org/wiki/Analysis_of_variance ANOVA], then depending on if the results of this comparison are significant, move on to post-hoc tests such as [http://en.wikipedia.org/wiki/Tukey%27s_range_test TukeyHSD]:
Residuals 8 4.59 0.57
</pre>
*First look at the genotype:diet column. If this p-value is <0.05 then you have a significant interaction between genotype and diet. If this is the case move on to [[#No Main Effect]] to separate out your groups. If this value is >0.05 then there is no interaction, check if the p value for either of your groups is significant. If it is (and there is no interaction) then go ahead to [[#Main Efect]]. In the above example there is no interaction, but there are two main effects:
====Main Effect====
==Correlations==
This is when two variables are correlated rather than one of them being discreet