Output from sexfun-chisq.R

library(vcd)
data(SexualFun)
SexualFun  # show the table
##               Wife
## Husband        Never Fun Fairly Often Very Often Always fun
##   Never Fun            7            7          2          3
##   Fairly Often         2            8          3          7
##   Very Often           1            5          4          9
##   Always fun           2            8          9         14
chisq.test(SexualFun)  # general association
## Warning: Chi-squared approximation may be incorrect
## 
## 	Pearson's Chi-squared test
## 
## data:  SexualFun 
## X-squared = 16.96, df = 9, p-value = 0.04942
fisher.test(SexualFun)  # exact test
## 
## 	Fisher's Exact Test for Count Data
## 
## data:  SexualFun 
## p-value = 0.09578
## alternative hypothesis: two.sided
assocstats(SexualFun)  # association statistics
##                     X^2 df P(> X^2)
## Likelihood Ratio 15.486  9 0.078421
## Pearson          16.955  9 0.049422
## 
## Phi-Coefficient   : 0.432 
## Contingency Coeff.: 0.396 
## Cramer's V        : 0.249

Generated with R version 2.15.1 (2012-06-22) using the R package knitr (version 0.8.4) on Wed Sep 26 09:01:21 2012.