forked from statOmics/PSLS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_1_poison1.Rmd
107 lines (66 loc) · 2.75 KB
/
08_1_poison1.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
95
96
97
98
99
100
101
102
103
104
105
106
107
---
title: "Exercise 8.1: Additive linear model on the poison dataset"
author: "Lieven Clement and Jeroen Gilis"
date: "statOmics, Ghent University (https://statomics.github.io)"
---
# The poison dataset
In this experiment, 96 fish (dojofish, goldfish and zebrafish)
were placed separately in a tank with two liters of water and
a certain dose (in mg) of the poison EI-43,064. The resistance
of the fish against the poison was measured as the amount of
minutes the fish survived after being exposed to the poison (`Surv_time`, in
minutes). Additionally, the weight of each fish was measured.
# Goal
In this tutorial session we will focus on **Dojofish**, and we will model the
survival time in function of the poison dose while correcting for the weight of
the fish.
1. We will first analyse the survival data by only considering the dose as an
explanatory variable for survival time
2. Next we will model the survival data with and additive model for dose and
weight
Load libraries
```{r, message=FALSE, warning=FALSE}
```
# Import the data
```{r, message=FALSE}
```
# Data tidying
We can see a couple of things in the data that can be improved:
1. Capitalise the fist column name
3. Set the Species column as a factor
4. Change the species factor levels from "0" to Dojofish.
*Hint*: use the `fct_recode` function.
4. In the previous analysis on this dataset
(`Simple linear regression session`), we performed a log-transformation on the
response variable `Surv_time` to meet the normality and homoscedasticity
assumptions of the linear model. Here, we will immediately work with
log-transformed survival times; store these in the new variable `log2Surv_time`
and remove the non-transformed values.
5. Subset the data to only retain **dojofish** (species "0").
```{r}
```
# Data exploration
Prior to the analysis, we should explore our data. To start our data
exploration, we will make use of the `ggpairs` function of the
`GGally` R package. This function will generate a visualization containing
multiple panels, which display (1) univariate plots of the different variables
in our dataset, (2) bivariate plots and (3) correlation coefficients between
the different variables.
```{r}
```
# Question 1: simple linear regression
## Model specification
Describe the model that you will use for this simple linear regression analysis.
## Assess model assumptions
## Inference
Use the model to test the parameters of interest.
## Conclusion
On the transformed and the original scale.
# Question 2: Analysis with additive effect for weight
## Model specification
Describe the model that you will use for this additive linear model.
## Assess model assumptions
## Inference
Use the model to test the parameters of interest.
## Conclusion
On the transformed and the original scale.