title: How to get Stargazer Summary Statistics by Year from Panel Data
body: <p>I have a panel data set with 159 countries between 2009 and 2017.</p>
  <p>When I use Stargazer to create a table with summary statistics it uses the values for all years.
  E.g. the mean of GDP would be the mean value for all countries and years.</p>
  <p>What I would like to get is the summary statistics of each year.
  E.g. Summary statistics for 2009, 2010,..., 2017.</p>
  <p>The panel data set looks like this:</p>
  <pre><code>   area_code year   area_name         area_group Executive Constraints Government Effectiveness
  1        AFG 2009 Afghanistan       Asia-Pacific              39.60269                 28.00944
  2        AFG 2010 Afghanistan       Asia-Pacific              39.60269                 28.07446
  3        AFG 2011 Afghanistan       Asia-Pacific              39.60269                 20.82287
  4        AFG 2012 Afghanistan       Asia-Pacific              39.60269                 20.85591
  5        AFG 2013 Afghanistan       Asia-Pacific              39.60269                 21.32710
  6        AFG 2014 Afghanistan       Asia-Pacific              39.60269                 21.19488
  7        AFG 2015 Afghanistan       Asia-Pacific              39.60269                 21.48040
  8        AFG 2016 Afghanistan       Asia-Pacific              38.26936                 21.52523
  9        AFG 2017 Afghanistan       Asia-Pacific              38.93603                 26.52632
  10       AGO 2009      Angola Sub-Saharan Africa              37.83082                 22.59876
  11       AGO 2010      Angola Sub-Saharan Africa              37.83082                 23.14201
  12       AGO 2011      Angola Sub-Saharan Africa              37.83082                 32.67216
  13       AGO 2012      Angola Sub-Saharan Africa              37.83082                 32.39330
  14       AGO 2013      Angola Sub-Saharan Africa              37.83082                 33.26756
  15       AGO 2014      Angola Sub-Saharan Africa              37.83082                 32.09595
  </code></pre>
  <p>Ideally I would like to get an output for a the year(s) specified.</p>
  <p>E.g. For 2009:</p>
  <pre><code>Descriptive statistics 2009
  ================================================================================================================
  Statistic                                     N      Mean     St. Dev.    Min   Pctl(25)   Pctl(75)      Max    
  ----------------------------------------------------------------------------------------------------------------
  Executive Constraints                       1,412   55.484     16.464   17.545   42.888     64.848     94.848   
  Government Effectiveness                    1,412   52.581     21.991    8.305   36.281     65.687     96.493  
  </code></pre>