-
Notifications
You must be signed in to change notification settings - Fork 0
/
_DescriptiveStatistics-1.Rmd
202 lines (123 loc) · 3.31 KB
/
_DescriptiveStatistics-1.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
title: "My R Codes For Data Analysis"
subtitle: "In this repository I am going to collect `R codes` for data analysis. Codes are from various resources and I try to give original link as much as possible."
author: "[Serdar Balcı, MD, Pathologist](https://www.serdarbalci.com/)"
date: '`r # format(Sys.Date())`'
output:
html_notebook:
fig_caption: yes
highlight: tango
number_sections: yes
theme: paper
toc: yes
toc_depth: 5
toc_float: yes
html_document:
code_folding: hide
df_print: kable
keep_md: yes
number_sections: yes
theme: cerulean
toc: yes
toc_float: yes
highlight: kate
---
## Descriptive Statistics
```r
Epi::stat.table(gender,mean(age), data = scabies)
```
```r
table <- Epi::stat.table(gender,mean(age), data = scabies)
pander::pander(table)
```
```r
#Tabulate, by gender, the mean age from the scabies dataset
Epi::stat.table(gender,list(mean(age),median(age)), data = scabies)
```
```r
summary_data <- arsenal::tableby(gender~age+scabies_infestation,data=scabies)
summary(summary_data)
```
## skimr
https://cran.r-project.org/web/packages/skimr/vignettes/Using_skimr.html
```r
require(skimr)
```
```r
summary(iris)
```
```r
summary(iris$Sepal.Length)
```
```r
fivenum(iris$Sepal.Length)
```
```r
summary(iris$Species)
```
```r
skim(iris)
```
```r
iris_results <- skim(iris)
str(iris_results)
iris_results$variable
iris_results$type
```
```r
skimr::skim(iris) %>%
dplyr::filter(stat == "mean")
```
```r
head(iris_results, n=15)
```
```r
mtcars %>%
dplyr::group_by(gear) %>%
skim()
```
```r
skim(iris, Sepal.Length, Species)
```
```r
skim(iris, starts_with("Sepal"))
```
```r
skim(datasets::lynx)
```
- Exploratory Data Analysis in R (introduction)
https://blog.datascienceheroes.com/exploratory-data-analysis-in-r-intro/
```r
library(tidyverse)
library(summarytools)
# library(funModeling)
library(tidyverse)
library(Hmisc)
basic_eda <- function(data)
{
glimpse(data)
# df_status(data)
# freq(data)
# profiling_num(data)
# plot_num(data)
describe(data)
}
basic_eda(irisdata)
```
---
- **What's so hard about histograms?**
http://tinlizzie.org/~aran/histograms/
---
# DataExplorer
---
# Webinar: Tidyverse Exploratory Analysis (Emily Robinson)
<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2F726282547396228%2Fvideos%2F584417861986887%2F&show_text=1&width=560" width="560" height="529" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media" allowFullScreen="true"></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/uG3igAGX7UE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
https://hookedondata.org/the-lesser-known-stars-of-the-tidyverse/
https://www.rstudio.com/resources/videos/the-lesser-known-stars-of-the-tidyverse/
https://github.com/robinsones/robinsones_blog/blob/master/content/post/multipleChoiceResponses.csv
https://github.com/robinsones/robinsones_blog/blob/master/content/post/2018-11-16-the-lesser-known-stars-of-the-tidyverse.Rmd
# I “only” use R for descriptive stats — and that’s OK
https://rforeval.com/descriptive-stats-r/
# histograms
http://tinlizzie.org/histograms/