title: Data structure for logistic regression in R
body: <p>I'd like to do a logistic regression on (proportions) count data, but I'm not sure which data format is correct. My question is in regards to how data should be formatted/structured for R's glm function to work the way it's designed to.</p>
  <p>If my research question is: Is the proportion of 'empty_counts' to 'full_counts' the same for each place and year of collection (and if not, where are the differences)?, should the data be organized like dataframe &quot;A&quot; or &quot;B&quot;? As in, should the data be in the form of: the number of rows are counts of &quot;success&quot;'s &amp; &quot;failure&quot;'s or a summary table style of counts between two columns ('empty_counts' to 'full_counts').</p>
  <pre><code>*Success/failure structure (0 = full_count, 1 = empty_count)
  &gt; head(dfA)
    Place      Year   empty_count
  1 Crocodile  2017   0
  2 Crocodile  2017   0
  3 Crocodile  2016   1
  4 Whipray    2018   0
  5 Whipray    2018   1
  6 Whipray    2018   1
  
  *Aggregated sums
  &gt; head(dfB)
    Place      Year   total_count  empty_count   full_count
  1 Crocodile  2017   2            0             2
  2 Crocodile  2016   1            1             0
  5 Whipray    2018   3            2             1
   
  R code should be(?):
  model &lt;- glm(empty_count ~ Place + Year, data = dfA, family = binomial) # Or...
  
  model &lt;- glm(cbind(empty_count,  full_count) ~ Place + Year, data = dfB, family = binomial)
  </code></pre>
  <ul>
  <li>Also, as a side-note, do I need a continuity correction?</li>
  </ul>