title: chi square on gender in two groups in R
body: <p>I am trying to do a chi square test on gender in two groups </p>
  
  <pre><code>#My data is: 
  G1_F=10 #group 1, female
  G1_M=14 #group2, male
  G2_F=9
  G2_M=15
  </code></pre>
  
  <p>I know the answer is a p-value on 0.77, but how do i get to this? 
  If I make a matrix and calculate "chisq.test" (see below), I get the result: X-squared = 0, df = 1, p-value = 1</p>
  
  <pre><code>genderG = matrix( 
  c(PDF, PDM, CF, CM), nrow=2, ncol=2) 
  genderG
  
  # Calculating p-sqaure and test statistics
  chisq.test(genderG)
  </code></pre>