---
title: "Validate Statsomat/edapy"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE)
```

```{r}
# Import
library(pastecs)
library(Hmisc)
library(knitr)
library(data.table)
library(psych)

# Upload and prepare dfs
filepath = "HolzingerSwineford1939.csv"
df <- fread(filepath, data.table=FALSE)
```

# Dataset HolzingerSwineford1939.csv

```{r}
# Data frame of the continuous variables
cols_continuous = c(0,1,7,8,9,10,11,12,13,14,15)
cols_continuous <- cols_continuous+1
df_num <- df[,cols_continuous]

# Validate table for continuous variables
kable(stat.desc(df_num),digits=2)
psych::describe(df_num)
```


```{r}
# Data frame of the discrete variables
cols_discrete <- c(2,3,4,5,6)
cols_discrete <- cols_discrete+1
df_cat = df[,cols_discrete]

# Validate tables for discrete variables 
Hmisc::describe(df_cat)
```

# Dataset Baitingdata.csv

```{r}
# Upload and prepare dfs
filepath = "Baitingdata.csv"
df <- fread(filepath, data.table=FALSE)
```

```{r}
# Data frame of the continuous variables
cols_continuous = c(9,10,11,12,22,23,24)
cols_continuous <- cols_continuous+1
df_num <- df[,cols_continuous]

# Validate table for continuous variables
kable(stat.desc(df_num),digits=2)
psych::describe(df_num)
```


```{r}
# Data frame of the discrete variables
cols_discrete <- c(0,1,2,3,4,5,6,7,8,13,25,26,27,28,29,30,31,32)
cols_discrete <- cols_discrete+1
df_cat = df[,cols_discrete]

# Validate tables for discrete variables 
Hmisc::describe(df_cat)
```


# Dataset Finance.csv

```{r}
# Upload and prepare dfs
filepath = "Finance.csv"
df <- fread(filepath, dec = ",", data.table=FALSE)
```

```{r}
# Data frame of the continuous variables
df_num <- df

# Validate table for continuous variables
kable(stat.desc(df_num),digits=2)
psych::describe(df_num)
```

