MattJermyWright
9/18/2014 - 5:42 PM

Chi-Square 2x2 Test of Independence - R code

Chi-Square 2x2 Test of Independence - R code

group1Population = 	577958
group1Measured = 	6015
group2Population = 	235568
group2Measured = 	2115

data.table = matrix( 
  c(group1Population,group1Population-group1Measured, # Row 1
    group2Population,group2Population-group2Measured), # Row 2
  nrow=2,              # number of rows 
  ncol=2,              # number of columns 
  byrow = TRUE)
chisq.test(data.table)