Hi,

I have a dataset that looks as follows:

input float id long spec2010 str7 y2010 long spec2011 str7 y2011 long spec2012 str7 y2012 long spec2013 str7 y2013 long spec2014 str7 y2014 long spec2015 str7 y2015
1 3 "ct" 2 "ct" . "" 3 "st3" . "" . ""
2 . "" 3 "st5" 4 "st6" . "" . "" . ""
3 . "" . "" . "" . "" . "" . ""
4 . "" 2 "ct" 5 "st3" 5 "st4" . "" . ""
5 . "" . "" . "" . "" . "" 3 "st3"
6 . "" . "" . "" 4 "ct" 3 "st3" 3 "st4"
7 . "" . "" . "" . "" 5 "st8" . ""
8 2 "ct" 2 "ct" 4 "st3" . "" . "" . ""
9 . "" . "" . "" . "" . "" 3 "st6 st8"
end
label values spec2010 spec2
label values spec2011 spec2
label values spec2012 spec2
label values spec2013 spec2
label values spec2014 spec2
label values spec2015 spec2
label def spec2 2 "a", modify
label def spec2 3 "b", modify
label def spec2 4 "c", modify
label def spec2 5 "d", modify



What I would like to make is a frequency table that looks like so:
Columns- 2010-2017
Rows- represent grade ct, st3-8
I also want to reproduce these tables for 'spec' 1-5
2010 2011 2012 2013 2014 2015 2016 2017
ct
st3

My actual dataset has about 8,000 subjects. I've tried tabm and table but not having much luck so far.

I'd be very grateful for any help.

Thanks,
Carla