Statistical Analysis: Difference between revisions

added categories
m typo for comparison
Line 5: Line 5:
<pre>dataset <- read.csv("filename.csv") #generates a table called dataset with your values</pre>
<pre>dataset <- read.csv("filename.csv") #generates a table called dataset with your values</pre>


==Single Comparasons==
==Single Comparisons==
Don't forget to adjust these p-values for multiple comparasons if you are doing more than one test.
Don't forget to adjust these p-values for multiple comparisons if you are doing more than one test.


===If you have 2 groups you want to compare===
===If you have 2 groups you want to compare===
Line 28: Line 28:
===If you are testing one variable with more than one value (One Way ANOVA)===
===If you are testing one variable with more than one value (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.
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 comparason are significant, move on to post-hoc tests such as [http://en.wikipedia.org/wiki/Tukey%27s_range_test TukeyHSD]:
* 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]:
<pre>
<pre>
fit.aov <- aov(values ~ group, data=dataset) #generates an object names fit.aov
fit.aov <- aov(values ~ group, data=dataset) #generates an object names fit.aov
Line 57: Line 57:
TukeyHSD(fit.aov)
TukeyHSD(fit.aov)
</pre>
</pre>
This will generate all possible pairwise comparasons between your groups
This will generate all possible pairwise comparisons between your groups


====No Main Effect====
====No Main Effect====
Line 67: Line 67:
TukeyHS(wt.fit)
TukeyHS(wt.fit)
</pre>
</pre>
This will tell you, separate from the interaction, whether each pairwise comparason is significant.  You will have to repeat this by re-doing subset with each genotype and diet value as needed.
This will tell you, separate from the interaction, whether each pairwise comparison is significant.  You will have to repeat this by re-doing subset with each genotype and diet value as needed.


==Correlations==
==Correlations==
coming later...
coming later...
This is when two variables are correlated rather than one of them being discreet
This is when two variables are correlated rather than one of them being discreet