title: Chi squared goodness of fit for a geometric distribution
body: <p>As an assignment I had to develop and algorithm and generate a samples for a given geometric distribution with PMF</p>
  
  <p><img src="https://i.stack.imgur.com/7Wxdk.png" alt="enter image description here"></p>
  
  <p>Using the inverse transform method, I came up with the following expression for generating the values:</p>
  
  <p><img src="https://i.stack.imgur.com/FB7m5.png" alt="enter image description here"></p>
  
  <p>Where U represents a value, or n values depending on the size of the sample, drawn from a Unif(0,1) distribution and p is 0.3 as stated in the PMF above.</p>
  
  <p>I have the algorithm, the implementation in R and I already generated QQ Plots to visually assess the adjustment of the empirical values to the theoretical ones (generated with R), i.e., if the generated sample follows indeed the geometric distribution.</p>
  
  <p>Now I wanted to submit the generated sample to a goodness of fit test,  namely the Chi-square, yet I'm having trouble doing this in R.</p>