-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_DescriptiveStatistics.Rmd
199 lines (115 loc) · 3.4 KB
/
_DescriptiveStatistics.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
# My R Codes For Data Analysis
## Descriptive Statistics
```
{r eval=FALSE, include=FALSE, echo=TRUE}
Epi::stat.table(gender,mean(age), data = scabies)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
table <- Epi::stat.table(gender,mean(age), data = scabies)
pander::pander(table)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
#Tabulate, by gender, the mean age from the scabies dataset
Epi::stat.table(gender,list(mean(age),median(age)), data = scabies)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
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 eval=FALSE, include=FALSE, echo=TRUE}
require(skimr)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
summary(iris)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
summary(iris$Sepal.Length)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
fivenum(iris$Sepal.Length)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
summary(iris$Species)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
skim(iris)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
iris_results <- skim(iris)
str(iris_results)
iris_results$variable
iris_results$type
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
skimr::skim(iris) %>%
dplyr::filter(stat == mean )
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
head(iris_results, n=15)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
mtcars %>%
dplyr::group_by(gear) %>%
skim()
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
skim(iris, Sepal.Length, Species)
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
skim(iris, starts_with( Sepal ))
```
```
{r eval=FALSE, include=FALSE, echo=TRUE}
skim(datasets::lynx)
```
- Exploratory Data Analysis in R (introduction)
https://blog.datascienceheroes.com/exploratory-data-analysis-in-r-intro/
```
{r eval=FALSE, include=FALSE, echo=TRUE}
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/