-
Notifications
You must be signed in to change notification settings - Fork 0
/
pHFemaleBroodstockHistoAnalysis.Rmd
94 lines (75 loc) · 3.41 KB
/
pHFemaleBroodstockHistoAnalysis.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: "pH Female Broodstock Histology Analysis"
author: "Shelly Trigg"
date: "9/24/2019"
output: rmarkdown::github_document
---
Load libraries
```{r}
library(readxl)
library(ggplot2)
```
Read in data
```{r}
female_data <- read_xlsx("HistologyScores.xlsx", sheet = 1)
```
Plot percent follicle area for each treatment group
```{r follicle area plot}
ggplot(data = female_data, aes(x = pH,y = perc_follicle_area, group = as.factor(pH), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("follicle area (%)") + theme_bw()
```
Run wilcox test to see if follicle area is significantly different
```{r}
pH6.8 <- subset(female_data, pH == "6.8", perc_follicle_area, drop = TRUE)
pHamb <- subset(female_data, pH == "amb", perc_follicle_area, drop = TRUE)
wt <- wilcox.test(pH6.8, pHamb)
print(wt$p.value)
```
Plot percent follicle area for each tank
```{r follicle area plot by tank}
ggplot(data = female_data, aes(x = tank,y = perc_follicle_area, group = as.factor(tank), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("follicle area (%)") + theme_bw()
```
anova to see if there is a tank or a pH effect
```{r}
model <- aov(perc_follicle_area ~ pH * tank, data = female_data)
summary(model)
```
Plot percent egg area for each treatment group
```{r egg area plot}
ggplot(data = female_data, aes(x = pH,y = perc_egg_area, group = as.factor(pH), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("egg area (%)") + theme_bw()
```
Run wilcox test to see if egg area is significantly different
```{r}
pH6.8 <- subset(female_data, pH == "6.8", perc_egg_area, drop = TRUE)
pHamb <- subset(female_data, pH == "amb", perc_egg_area, drop = TRUE)
wt <- wilcox.test(pH6.8, pHamb)
print(wt$p.value)
```
Plot percent egg area for each tank
```{r egg area plot by tank}
ggplot(data = female_data, aes(x = tank,y = perc_egg_area, group = as.factor(tank), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("egg area (%)") + theme_bw()
```
anova to see if there is a tank or a pH effect
```{r}
model <- aov(perc_egg_area ~ pH * tank, data = female_data)
summary(model)
```
Plot egg:follicle ratio for each treatment group
```{r egg-follicle ratio plot }
ggplot(data = female_data, aes(x = pH,y = follicle_egg_ratio, group = as.factor(pH), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("egg:follicle ratio") + theme_bw()
```
Run wilcox test to see if egg:follicle ratio is significantly different
```{r}
pH6.8 <- subset(female_data, pH == "6.8", follicle_egg_ratio, drop = TRUE)
pHamb <- subset(female_data, pH == "amb", follicle_egg_ratio, drop = TRUE)
wt <- wilcox.test(pH6.8, pHamb)
print(wt$p.value)
```
Plot egg:follicle ratio for each tank
```{r egg:follicle ratio plot by tank}
ggplot(data = female_data, aes(x = tank,y = follicle_egg_ratio, group = as.factor(tank), fill = pH)) + geom_violin(trim = FALSE) + geom_boxplot(width = 0.2) + geom_jitter(shape =16, position= position_jitter(0.1)) + ylab("egg:follicle ratio") + theme_bw()
```
anova to see if there is a tank or a pH effect
```{r}
model <- aov(follicle_egg_ratio ~ pH * tank, data = female_data)
summary(model)
```