README.md 9.12 KB
Newer Older
1
2
3
[//]: # "#to make links in gitlab: example with racon https://github.com/isovic/racon"
[//]: # "tricks in markdown: https://openclassrooms.com/fr/courses/1304236-redigez-en-markdown"

4
5
| usage | R dependencies |
| --- | --- |
Gael's avatar
Gael committed
6
| [![R Version](https://img.shields.io/badge/code-R-blue?style=plastic)](https://cran.r-project.org/mirrors.html) | [![Dependencies: R Version](https://img.shields.io/badge/R-v4.0.2-blue?style=plastic)](https://cran.r-project.org/mirrors.html) |
Gael's avatar
Gael committed
7
| [![License: GPL-3.0](https://img.shields.io/badge/licence-GPL%20(%3E%3D3)-green?style=plastic)](https://www.gnu.org/licenses) | [![Dependencies: R Package](https://img.shields.io/badge/package-car%20v3.0.9-blue?style=plastic)](https://cran.r-project.org/web/packages/car/index.html) |
Gael's avatar
Gael committed
8
| | [![Dependencies: R Package](https://img.shields.io/badge/package-carData%20v3.0.4-blue?style=plastic)](https://cran.r-project.org/web/packages/carData/index.html) |
Gael's avatar
Gael committed
9
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-emmeans%20v1.5.0-blue?style=plastic)](https://cran.r-project.org/web/packages/emmeans/index.html) |
10
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-ggplot2%20v3.3.2-blue?style=plastic)](https://github.com/tidyverse/ggplot2) |
Gael's avatar
Gael committed
11
12
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-jpeg%20v0.1_8.1-blue?style=plastic)](https://cran.r-project.org/web/packages/jpeg/index.html) |
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-lemon%20v0.4.5-blue?style=plastic)](https://cran.r-project.org/web/packages/lemon/index.html) |
Gael's avatar
Gael committed
13
14
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-lme4%20v1.1.23-blue?style=plastic)](https://cran.r-project.org/web/packages/lme4/index.html)|
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-lmerTest%20v3.1.2-blue?style=plastic)](https://cran.r-project.org/web/packages/lmerTest/index.html) |
15
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-lubridate%20v1.7.9-blue?style=plastic)](https://github.com/tidyverse/lubridate) |
Gael's avatar
Gael committed
16
|  | [![Dependencies: R Package](https://img.shields.io/badge/package-Matrix%20v1.2.18-blue?style=plastic)](https://cran.r-project.org/web/packages/Matrix/index.html) |
17
|  | [![Dependencies: R Package](https://img.shields.io/badge/toolbox-cute%20little%20R%20functions%20v6.0.0-blue?style=plastic)](https://gitlab.pasteur.fr/gmillot/cute_little_R_functions) |
18
19
20
21
22


## TABLE OF CONTENTS

   - [AIM](#aim)
Gael  MILLOT's avatar
test    
Gael MILLOT committed
23
24
25
   - [CONTENT](#content)
   - [HOW TO RUN](#how-to-run)
   - [OUTPUT](#output)
26
27
28
29
   - [VERSIONS](#versions)
   - [LICENCE](#licence)
   - [CITATION](#citation)
   - [CREDITS](#credits)
30
   - [ACKNOWLEDGEMENTS](#Acknowledgements)
31
32
33
34
35
   - [WHAT'S NEW IN](#what's-new-in)


## AIM

36
Versatile tool for ANOVA and 2 x 2 contrast analysis
37

Gael's avatar
Gael committed
38
Support one-way or two-ways ANOVA, multiple ANOVAs in batch, Type I, II or III, complete random design or block design, balanced or unbalanced design, nested situation, aliased and interacting factors
39
40


41
## CONTENT
42

43
**anova_contrasts.R** file that can be executed using a CLI (command line interface) or sourced in R or RStudio
44

45
**anova_contrasts.config** parameter settings for the anova_contrasts.R file
46

47
**dataset** folder containing some datasets than can be used as examples
48

Gael's avatar
Gael committed
49
50
**dev** folder containing data for current or future developments

51
**example_of_result** folder containing an example of result obtained with the Internatilzation dataset
52
53


54
## HOW TO RUN anova_contrasts
55
56
57

### Using a R GUI (graphic user interface, i.e., R or RStudio windows)

58
1) Open the anova_contrasts.config file and set the parameters. The file must be present in the same directory as anova_contrasts.R
59
60
61

2) Open R or RStudio

62
3) Source the anova_contrasts.R file, for instance using the following instruction:
63

Gael's avatar
Gael committed
64
	`  source("C:/Users/Gael/Desktop/anova_contrasts.R")  `
65
66
67
68


### Using a R CLI (command line interface)

69
1) Open the anova_contrasts.config file and set the parameters. The file must be present in the same directory as anova_contrasts.R
70
71
72

2) Open a shell windows

73
3) run anova_contrasts.R, for instance using the following instruction:
74

Gael's avatar
Gael committed
75
	`  Rscript anova_contrasts.R anova_contrasts.config  `
Gael's avatar
Gael committed
76

77
78
For cygwin, use something like:

Gael's avatar
Gael committed
79
`  /cygdrive/c/Program\ Files/R/R-4.0.2/bin/Rscript anova_contrasts.R anova_contrasts.config  `
80
81


82
## anova_contrasts OUTPUT
83
84
85

| Mandatory Files | Description |
| --- | --- |
Gael's avatar
Gael committed
86
| **anova_contrasts_xxxxxxxxxx_report.txt** | report file |
87
| **all_objects.RData** | R file containing all the objects created during the run. Open it to inspects the objects |
88
| **graph.pdf** | some plots, including the distribution of the quantitative variable and analysis of residuals |
89

Gael's avatar
Gael committed
90
91
92
| Optional Files | Description |
| --- | --- |
| **modified_dataset.txt** | initial dataset modified by the script (NA removal, log transfo, etc.)|
Gael's avatar
Gael committed
93
94
| **full_contingency_table.txt** | full contingency table (if too big to be printed in the report)|
| **<CLASS_OF_INDEP_QUALI_VAR>_full_contingency_table.txt** | full contingency table for each class of the indep.quali.var parameter (if too big to be printed in the report)|
Gael's avatar
Gael committed
95

96
| Optional Files (non NULL contrast.var parameter) | Description |
97
| --- | --- |
98
99
100
101
102
103
104
105
| **pvalue_results_1.txt** | table of the 2 x 2 contrast tests performed when the model1 parameter is non NULL|
| **pvalue_results_2.txt** | table of the 2 x 2 contrast tests performed when the model2 parameter is non NULL|
| **pvalue_results_3.txt** | table of the 2 x 2 contrast tests performed when the model3 parameter is non NULL|
| **pvalue_results_total.txt** | table of the 2 x 2 contrast tests performed using the different models, if more than one model1, model2, model3 parameters are non NULL|
| **pvalue_results_1.RData** | equivalent to the pvalue_results_1.txt but as R object|
| **pvalue_results_2.RData** | equivalent to the pvalue_results_1.txt but as R object|
| **pvalue_results_3.RData** | equivalent to the pvalue_results_1.txt but as R object|
| **pvalue_results_total.RData** | equivalent to the pvalue_results_total.txt but as R object|
106

Gael's avatar
Gael committed
107
108
109
110
| Optional Files (test.log.cor parameter set to TRUE) | Description |
| --- | --- |
| **modified_dataset_for_log2_test.txt** | initial dataset with three columns added to test the effect of the abs(min(yi)) + 1 correction used during log2 transformation|

Gael's avatar
Gael committed
111
112
113
114
115
| Optional Files (non NULL simple.model parameter) | Description |
| --- | --- |
| **simple_pvalue_results.txt** | table of the 2 x 2 t tests with Welch correction|
| **pvalue_results_4.RData** | equivalent to the simple_pvalue_results.txt but as R object|

116
117
118

## VERSIONS

119
The different releases are tagged [here](https://gitlab.pasteur.fr/gmillot/anova_contrasts/-/tags)
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138


## LICENCE

This package of scripts can be redistributed and/or modified under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchandability or fitness for a particular purpose.
See the GNU General Public License for more details at https://www.gnu.org/licenses.


## CITATION

Not yet published


## CREDITS

[Gael A. Millot](https://gitlab.pasteur.fr/gmillot), Hub-CBD, Institut Pasteur, USR 3756 IP CNRS, Paris, France


139
140
## ACKNOWLEDGEMENTS

Gael's avatar
Gael committed
141
142
Thomas Obadia, Hub-CBD, Institut Pasteur, Paris, France

143
Stevenn Volant, Hub-CBD, Institut Pasteur, Paris, France
Gael's avatar
Gael committed
144

145
Hugo Varet, Hub-CBD, Institut Pasteur, Paris, France
Gael's avatar
Gael committed
146

Gael's avatar
Gael committed
147
148
Amaury Vaysse, Hub-CBD, Institut Pasteur, Paris, France

149
R and R packages developers
Gael's avatar
Gael committed
150

151
Gitlab developers
Gael's avatar
Gael committed
152

153
154
Neter J, Kutner MH, Nachtsheim CJ, Wasserman W. Applied Linear Statistical Models 4th Edition. 1990. Erwin Editions. ISBN 0-256-11736-5

155
156
157

## WHAT'S NEW IN

Gael's avatar
Gael committed
158
159
160
161
162
### v5.2.0

1) config file now present in the result folder


Gael's avatar
Gael committed
163
164
165
166
167
### v5.1.0

1) Bug corrected


Gael's avatar
Gael committed
168
169
170
171
172
### v5.0.0

1) comparison of difference of effects (in model with interaction) added in emmean contrast analysis


Gael's avatar
Gael committed
173
174
175
176
177
### v4.15.0

1) bug fixed for welch test p value display


Gael's avatar
Gael committed
178
179
180
181
182
### v4.14.0

1) clearer messages added


Gael's avatar
Gael committed
183
184
185
186
187
### v4.13.0

1) bug fixed for welch test p value display


Gael's avatar
Gael committed
188
189
190
191
192
### v4.12.0

1) bug fixed for welch test p value display


Gael's avatar
Gael committed
193
194
195
196
197
### v4.11.0

1) bug fixed concerning the number of predictive variables detected


Gael's avatar
Gael committed
198
199
200
201
202
### v4.10.0

1) negative and 0 values can be removed before log transfo


Gael's avatar
Gael committed
203
204
### v4.9.1

Gael's avatar
Gael committed
205
1) t test added for one-way anova (improved)
Gael's avatar
Gael committed
206
207


Gael's avatar
Gael committed
208
209
210
211
212
### v4.9.0

1) t test added for one way anova


Gael's avatar
Gael committed
213
214
215
216
217
### v4.8.0

1) messages of ancova improved


Gael's avatar
Gael committed
218
219
220
221
222
### v4.7.0

1) now possibility to deal with ancova


Gael's avatar
Gael committed
223
224
225
226
227
### v4.6.0

1) Improvement of Type I,II,III messages for all the 3 models (continued)


Gael's avatar
Gael committed
228
229
230
231
232
### v4.5.0

1) Improvement of Type I,II,III messages for all the 3 models


Gael's avatar
Gael committed
233
234
235
236
237
### v4.4.0

1) type III anova added for model1


Gael's avatar
Gael committed
238
239
240
241
242
### v4.3.0

1) response.var.not.log2 repoved from analysis of factors independently


Gael's avatar
Gael committed
243
244
245
246
247
### v4.2.0

1) New response.var.class.rm parameter added


Gael's avatar
Gael committed
248
249
250
251
252
### v4.1.0

1) No log transfo in the simple model


Gael's avatar
Gael committed
253
254
255
256
257
258
259
### v4.0.0

1) Simple model added

2) R v4.0.5


Gael's avatar
Gael committed
260
261
262
263
264
### v3.3.0

1) bug removed in contingency tables


Gael's avatar
Gael committed
265
266
267
268
269
### v3.2.0

1) contingency tables improved


Gael's avatar
Gael committed
270
271
272
273
274
### v3.1.0

1) bug removed


Gael's avatar
Gael committed
275
276
277
278
279
280
281
282
### v3.0.0

1) test.log.cor parameter modified

2) part debuged

3) Display of contingency table improved

283

Gael's avatar
Gael committed
284
285
286
287
288
### v2.0.0

Upgrade for R4.0.2, among other improvements


289
290
291
292
293
### v1.0.0

Everything


294