title: Chi-squared Test in R (to compare real data to theoretical normal distribution)
body: <p>I’d like to make a Chi-squared Test to compare my data (column “real”) with the theoretical normal distribution (column “theor”), that was calculated (in Excel) by the parameters of the big real sample (processing of this sample to ranks - is the column “real”).</p>
  
  <p>What test in R I should use for this purpose?</p>
  
  <p>At first I thought that it should be <code>chisq.test</code></p>
  
  <p>But I compare its result to the result of the function “CHI2TEST” in EXCEL (that should give the same result) and these results were quite different. It gives p-value = 0.2426, and CHI2TEST of Excel gives p-value 0.87. </p>
  
  <p>Maybe I used <code>chisq.test</code> incorrectly? Could you check my script or advise me correct test for Chi-squared Test in R?</p>
  
  <pre><code>&gt; real
  [1]  2  3 15 22 21 14  2  1
  &gt; theor
  [1]  1.4  5.7 14.1 21.6 20.2 11.6  4.1  0.9
  &gt; chisq.test (real,theor)
  
          Pearson's Chi-squared test
  
  data:  real and theor
  X-squared = 48, df = 42, p-value = 0.2426  
  
  Warning message:
  In chisq.test(real, theor) : Chi-squared approximation may be incorrect
  </code></pre>