  In this paper, we describe how the hypergeometric test can be used to
determine whether a given theme of interest occurs in a storyset at a frequency
more than would be expected by chance. By a storyset we mean simply a list of
stories defined according to a common attribute (e.g., author, movement,
period). The test works roughly as follows: Given a background storyset and a
sub-storyset of interest, the test determines whether a given theme is
over-represented in the sub-storyset, based on comparing the proportions of
stories in the sub-storyset and background storyset featuring the theme. A
storyset is said to be "enriched" for a theme with respect to a particular
background storyset, when the theme is identified as being significantly
over-represented by the test. Furthermore, we introduce here a toy dataset
consisting of 280 manually themed Star Trek television franchise episodes. As a
proof of concept, we use the hypergeometric test to analyze the Star Trek
stories for enriched themes. The hypergeometric testing approach to theme
enrichment analysis is implemented for the Star Trek thematic dataset in the R
package stoRy. A related R Shiny web application can be found at
https://github.com/theme-ontology/shiny-apps.
