Dear all,
for a variable called classification we want to count the amount of times it has I, per year and per company (defined as the variable CUSIP8).
This is our dataset:
CUSIP8 Year classification
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 L
000361 2004 E
000361 2004 I
000361 2005 E
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 E
000361 2006 I
000361 2006 I
000361 2006 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 E
000361 2007 E
000361 2007 I
000361 2007 I
000361 2007 I
000361 2008 E
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 E
000361 2008 I
000361 2008 I
000361 2008 I
000361 2009 I
000361 2009 E
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 E
000361 2009 I
000361 2009 I
000361 2009 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 E
000361 2010 I
000361 2010 I
000361 2010 E
000361 2010 I
000361 2011 E
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 E
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2012 I
000361 2012 E
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 E
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 E
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 E
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 E
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 E
000361 2014 I
000957 2004 L
000957 2004 I
000957 2004 E
000957 2004 L
000957 2004 I
000957 2004 I
000957 2004 E
000957 2004 I
000957 2004 I
000957 2005 I
000957 2005 L
000957 2005 E
000957 2005 I
000957 2005 I
000957 2005 L
000957 2005 L
000957 2005 I
000957 2005 I
000957 2006 I
000957 2006 I
000957 2006 I
000957 2006 L
000957 2006 I
So the question is: what is the command for a new variable that shows the number of the amount of times there is a ' I ' in the data of classification per year and per firm.
for a variable called classification we want to count the amount of times it has I, per year and per company (defined as the variable CUSIP8).
This is our dataset:
CUSIP8 Year classification
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 I
000361 2004 L
000361 2004 E
000361 2004 I
000361 2005 E
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2005 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 I
000361 2006 E
000361 2006 I
000361 2006 I
000361 2006 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 I
000361 2007 E
000361 2007 E
000361 2007 I
000361 2007 I
000361 2007 I
000361 2008 E
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 I
000361 2008 E
000361 2008 I
000361 2008 I
000361 2008 I
000361 2009 I
000361 2009 E
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 I
000361 2009 E
000361 2009 I
000361 2009 I
000361 2009 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 I
000361 2010 E
000361 2010 I
000361 2010 I
000361 2010 E
000361 2010 I
000361 2011 E
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 E
000361 2011 I
000361 2011 I
000361 2011 I
000361 2011 I
000361 2012 I
000361 2012 E
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 E
000361 2012 I
000361 2012 I
000361 2012 I
000361 2012 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 E
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 I
000361 2013 E
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 E
000361 2014 I
000361 2014 I
000361 2014 I
000361 2014 E
000361 2014 I
000957 2004 L
000957 2004 I
000957 2004 E
000957 2004 L
000957 2004 I
000957 2004 I
000957 2004 E
000957 2004 I
000957 2004 I
000957 2005 I
000957 2005 L
000957 2005 E
000957 2005 I
000957 2005 I
000957 2005 L
000957 2005 L
000957 2005 I
000957 2005 I
000957 2006 I
000957 2006 I
000957 2006 I
000957 2006 L
000957 2006 I
So the question is: what is the command for a new variable that shows the number of the amount of times there is a ' I ' in the data of classification per year and per firm.