Created
November 12, 2013 17:13
-
-
Save dgrapov/7434794 to your computer and use it in GitHub Desktop.
Example of data summary tools.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#demonstration of data summary tools | |
#enable necessary functions | |
source("http://pastebin.com/raw.php?i=JVyTrYRD") | |
#get demo data | |
library(RCurl) | |
url<-getURL("https://docs.google.com/spreadsheet/pub?key=0Ap1AEMfo-fh9dGFHRk81cVJaMTIxUjQzSlo2RS1RZXc&single=true&gid=0&output=csv",ssl.verifypeer = FALSE) | |
tmp.data<-read.csv(textConnection(url)) | |
#Prepare to generate data summaries and conduct statitcal tests | |
factor<-data.frame(treatment=tmp.data$Treatment) #theses will be factors to test and summarize data on (should be discrete) | |
formula<-colnames(factor) # generate formula for anova | |
raw.data<-tmp.data[,-c(1:2)] # take out factor and row ID, use for summary | |
#carry out t-Tests with FDR and q-value calculation | |
t.stats<-multi.t.test(data=raw.data, factor=factor,paired=FALSE,progress=TRUE) | |
# carry out one-way ANOVA (same as unpaired t-Tests for two group comparison) and create data summary () | |
#------------------ | |
#complete data set (test on log, report summaries for non-log) | |
stats<-stats.summary(raw.data,comp.obj=factor,formula=formula,sigfigs=3,log=FALSE) | |
#optionally log transform data before test and then use log = TRUE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment