-
Notifications
You must be signed in to change notification settings - Fork 3
/
Measures for Coherences.Rmd
34 lines (24 loc) · 1.06 KB
/
Measures for Coherences.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
---
title: "Statistical Tests"
author: "Jan-Philipp Kolb"
date: "23. Juli 2015"
output: ioslides_presentation
---
## Cramer's V
> In statistics, Cramér's V (...) is a measure of association between two nominal variables, giving a value between 0 and +1 (inclusive). It is based on Pearson's chi-squared statistic and was published by Harald Cramér in 1946.
[Wikipedia - Cramer's V](https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V)
## [Cramer's V](http://sas-and-r.blogspot.de/2011/06/example-839-calculating-cramers-v.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+SASandR+%28SAS+and+R%29) in R
```{r}
cv.test = function(x,y) {
CV = sqrt(chisq.test(x, y, correct=FALSE)$statistic /
(length(x) * (min(length(unique(x)),length(unique(y))) - 1)))
print.noquote("Cramér V / Phi:")
return(as.numeric(CV))
}
```
```{r,cache=T}
helpdata = read.csv("http://www.math.smith.edu/r/data/help.csv")
with(helpdata, cv.test(female, homeless))
```
## Regression
[multivariate models](http://www.sowi.uni-mannheim.de/lehrstuehle/lessm/veranst/MultiVorlesung.pdf)