title: Using filter to calculate mean gives wrong value
body: <p>I have a panel data set and I am trying to calculate the mean value for different groups. I use the following function:</p>
  
  <pre><code>mean(x = filter(panel, dv_id== 1 )$price, y = filter(panel, dvv_id== 1)$price)
  </code></pre>
  
  <p>However, when I use this function:</p>
  
  <pre><code>panel %&gt;%
      group_by(dv_id, dvv_id) %&gt;%
      dplyr::summarize(Mean = mean(price, na.rm=TRUE))
  </code></pre>
  
  <p>I do get a different mean value for the group combination I am looking for.</p>