-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcorrelation.r
More file actions
19 lines (15 loc) · 931 Bytes
/
correlation.r
File metadata and controls
19 lines (15 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library(psych)
region_cells_BE <- read.csv('../data/train_BE/region_cells.csv')
subset_BE <- region_cells_BE[which(region_cells_BE$density>0 & region_cells_BE$density<30),]
biserial(region_cells_BE$density, region_cells_BE$hasstop) # 0.1756958
biserial(subset_BE$density, subset_BE$hasstop) # 0.4397582
# Outliers distort the correlation a lot!
# We only take a subset_BE of the data, with which we get a correlation of 0.4397582
boxplot(density~hasstop, data=subset_BE)
region_cells_NL <- read.csv('../data/train_NL/region_cells.csv')
subset_NL <- region_cells_NL[which(region_cells_NL$density>0 & region_cells_NL$density<6.3),]
biserial(region_cells_NL$density, region_cells_NL$hasstop) # 0.8780911
biserial(subset_NL$density, subset_NL$hasstop) # 0.4599671
# Outliers distort the correlation a lot!
# We only take a subset_NL of the data, with which we get a correlation of 0.4397582
boxplot(density~hasstop, data=subset_NL)