-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStats_Preservation.Rmd
55 lines (45 loc) · 1.89 KB
/
Stats_Preservation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Distribution and Difference Significance of Preservation Methods by Bodysite
============================================================================
Data imported from txt tables to R.
```{r}
feces <- read.csv("~/git/preservation_stats/presv_fig1_data/feces_fig1.csv")
oral <- read.csv("~/git/preservation_stats/presv_fig1_data/oral_fig1.csv")
skin <- read.csv("~/git/preservation_stats/presv_fig1_data/skin_fig1.csv")
```
```{r,echo=FALSE}
source("~/git/preservation_stats/scripts/distribution_test.R")
```
Each Preservation method will be extracted from their respective data tables
with a parser function for this porpose written in R named 'generate_vector()':
Example:
from BodySite 'feces'
```{r}
feces_ultralow = parse_vector(data=feces,line=1)
```
```{r,echo=FALSE}
print(feces_ultralow)
```
Then analyze through graphic of distribution to determine their
distribution if any
```{r}
#distribution_test() makes a summary of information from the
#data set and tries ploting a normal,uniform and exponential
#distribution graph from this data to fit the histogram of the sample.
#The aim of the graph-fit plot is to find ( if any) a distribution like
#behavior that could fit the data for testing and comparisons.
distribution_test(feces_ultralow)
```
As seen in the plot, the data doesnt fit any of the distribution
to which they where tested. This left us with only one posibility
being that our samples are to small, the only viable option is
to use a student-t test.
Since we need to find normality to used a student-t,
Shapiro-Wilk Normality test is performed on each Presv. Method.
```{r}
shapiro.test(feces_ultralow)
#Test P-value should be >= .95 to be consider
#a normal distribution thruogh this test.
```
Since the test result where that the samples couldnt be considered normal
The next approach is a Distribution-Free non Param. test called
Kolmogorov-Smirnov test.