Crosstables

Next to making frequency tables of one variable, we can also look at how often specific values on two variables occur together. We use cross tablulations for this purpose. Cross tabulations use the table() command again but then on two variables:

table(songs$THEME, 
      songs$YEAR)
                      
                       1916 1922 1928 1929 1931 1932 1935 1936 1938 1939 1940
  Heartbreak              0    0    0    0    1    0    0    0    0    0    0
  Life_and_death          0    0    2    0    0    0    1    0    0    0    0
  Love                    0    0    1    0    0    0    0    0    0    1    0
  Party_songs             0    0    0    0    0    0    0    0    1    0    0
  People_and_places       1    1    2    0    1    1    0    1    0    1    1
  Politics_and_protest    0    0    0    2    0    1    0    0    1    1    0
  Sex                     0    0    1    0    0    0    0    0    0    0    0
                      
                       1941 1944 1946 1949 1950 1951 1952 1953 1954 1955 1956
  Heartbreak              0    0    0    0    0    1    0    0    0    0    0
  Life_and_death          1    0    0    1    1    0    0    0    0    0    0
  Love                    0    0    0    0    0    0    1    0    1    1    5
  Party_songs             0    1    0    0    0    0    0    0    0    0    0
  People_and_places       1    0    2    0    1    2    0    1    2    1    4
  Politics_and_protest    0    1    0    0    0    0    0    0    0    0    0
  Sex                     0    0    0    0    0    0    0    0    1    1    0
                      
                       1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967
  Heartbreak              0    2    1    0    2    2    2    6    4    9    3
  Life_and_death          1    2    3    0    2    1    2    2    4    5    2
  Love                    0    1    2    1    4    2    5   11    4   11    6
  Party_songs             0    0    1    0    0    1    1    0    3    0    5
  People_and_places       0    1    3    3    5    1    3    3    8    7    9
  Politics_and_protest    0    0    0    1    0    0    3    5    6    1    3
  Sex                     2    0    0    0    1    0    1    0    4    4    5
                      
                       1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978
  Heartbreak              4    4    5    5    5    3    2    5    1    2    5
  Life_and_death          4    4    4    5    6    5    5    1    1    2    2
  Love                    7    2    3    3    6    8    6    3    1    5    4
  Party_songs             5    0    1    0    4    2    6    4    9    6    6
  People_and_places       8    5    0    6    2    2    4    4    1    4    2
  Politics_and_protest    6    8    8    7    0    2    1    2    4    6    2
  Sex                     5    8    2    4    4    2    3    4    1    2    4
                      
                       1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
  Heartbreak              4    3    2    1    3    4    1    5    2    2    1
  Life_and_death          2    3    1    3    1    2    1    1    2    3    2
  Love                    3    0    0    2    0    1    2    2    2    1    2
  Party_songs            17    5    7    5   11    7    2    1    4    1    4
  People_and_places       3    5    2    0    5    2    3    2    2    1    1
  Politics_and_protest    4    6    2    4    1    4    7    2    2    4    5
  Sex                     1    3    5    3    4    2    2    4    4    3    4
                      
                       1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
  Heartbreak              2    1    1    1    2    3    2    3    3    2    2
  Life_and_death          2    4    2    2    8    0    2    3    0    0    4
  Love                    0    0    2    1    3    3    1    0    0    0    2
  Party_songs             2    1    2    1    1    3    0    1    1    6    1
  People_and_places       0    1    0    2    0    1    0    0    1    1    0
  Politics_and_protest    1    1    4    1    0    0    1    0    0    1    1
  Sex                     3    2    3    3    4    2    1    1    2    1    2
                      
                       2001 2002 2003 2004 2005 2006 2007 2008
  Heartbreak              1    1    4    4    3    2    3    3
  Life_and_death          0    1    2    1    3    3    2    2
  Love                    1    0    2    0    0    0    3    1
  Party_songs             3    4    2    2    3    1    2    6
  People_and_places       1    1    0    0    3    2    1    1
  Politics_and_protest    0    2    1    2    3    3    4    4
  Sex                     1    3    3    0    0    3    1    2

In this cross tabulation we can see which themes in songs occurred how often in which years.

Back to top