forked from zacharycompton/cancerAcrossVertebrates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kruskalwilcox.R
37 lines (22 loc) · 1.12 KB
/
kruskalwilcox.R
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
library(tidyverse)
Data <- read.csv('min20-2022.05.16.csv')
neoClade<-kruskal.test(NeoplasiaPrevalence~Clade,data=Data)
malClade<-kruskal.test(MalignancyPrevalence~Clade,data=Data)
saur <- filter(Data, is.element(Clade, c("Sauropsida")))
mamm <- filter(Data, is.element(Clade, c("Mammalia")))
amph <- filter(Data, is.element(Clade, c("Amphibia")))
#Mammals vs Amphibians neo
mAmphN<-wilcox.test(mamm$NeoplasiaPrevalence, amph$NeoplasiaPrevalence)
#Mammals vs Amphibians mal
mAmphM<-wilcox.test(mamm$MalignancyPrevalence, amph$MalignancyPrevalence)
#Amphibians vs Sauropsids neo
aSaurN<-wilcox.test(amph$NeoplasiaPrevalence, saur$NeoplasiaPrevalence)
#Amphibians vs Sauropsids mal
aSaurM<-wilcox.test(amph$MalignancyPrevalence, saur$MalignancyPrevalence)
mAmphN[3]
PValues<-c(as.numeric(neoClade[3]), as.numeric(malClade[3]),as.numeric(mAmphN[3]),
as.numeric(mAmphM[3]),as.numeric(aSaurN[3]),as.numeric(aSaurM[3]))
Test<-c("Kruskal Neo",'Kruskal Mal', 'Mammal and Amphbian Neo',"Mammal and Amphibian Mal",
"Amphibian and Sauropsid Neo","Amphian and Suaropsid Mal")
results<-data.frame(Test, PValues)
view(results)