Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 19, 2020 17:23
Show Gist options
  • Save NyaGarcia/f9e1cd845c591af82588f0887a233cb7 to your computer and use it in GitHub Desktop.
Save NyaGarcia/f9e1cd845c591af82588f0887a233cb7 to your computer and use it in GitHub Desktop.
Calculating strength of association with the Phi Coefficient
> jobhappiness<-matrix(c(5,7,13,10), ncol = 2)
> rownames(jobhappiness)<-c("Developers", "Mathematicians")
> colnames(jobhappiness)<-c("Happy", "Unhappy")
> phi(jobhappiness)
[1] -0.14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment