-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatisticsBackground-Examples.qmd
56 lines (46 loc) · 1.14 KB
/
StatisticsBackground-Examples.qmd
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
---
title: "Solved examples for Statistics Background talks"
author: "Alex Sanchez"
output:
html_document:
code_folding: show
toc: yes
toc_float:
toc_collapsed: yes
toc_depth: 3
theme: cosmo
highlight: textmate
number_sections: yes
editor:
markdown:
wrap: 72
self_contained: true
---
```{r include=FALSE}
require(knitr)
opts_chunk$set(
concordance=FALSE, echo=TRUE, warning=FALSE, error=FALSE, message=FALSE)
```
# Data Exploration
Start loading toy dataset
```{r}
toyDataSet <- read.csv("datasets/toyDataSet.txt", sep="", row.names = 1)
```
Compute mean and sd rowwise and columnwise
```{r}
rowM<- apply (toyDataSet,1,mean)
rowSd <- apply (toyDataSet,1,sd)
toyDataSet2 <- data.frame(toyDataSet,means=rowM, SDs = rowSd)
colM<- apply (toyDataSet2,2,mean)
colSd <- apply (toyDataSet2,2,sd)
toyDataSet2 <- rbind(toyDataSet2,means=colM, SDs = colSd)
# install.packages("xlsx")
# WriteXLS::WriteXLS(toyDataSet, "toyDataset.xls")
kableExtra::kable(toyDataSet)
```
- With few variables, numerical summaries are useful, but warning with small sample size!
```{r}
#install(skimr)
library(skimr)
skim(t(toyDataSet))
```