{'fraction_non_alphanumeric': 0.021876799078871616, 'fraction_numerical': 0.0, 'mean_word_length': 5.076923076923077, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Bayesian inference for a stratified categorical variable allowing all possible category choices

In many sample surveys, there are items that require respondents to make at least one choice. For example, in the Kansas Farm Survey (conducted by the Department of Animal Sciences at Kansas State University), livestock farmers in Kansas were asked ‘What are your primary sources of veterinary information?’. According to the level of education, the sources are professional consultant, veterinarian, state or local extension service, magazines, and feed companies and representatives, and the farmers were allowed to pick as many sources that apply. We assume that each farmer made all his/her choices (i.e., there are no nonrespondents) and the number of farmers with none of these choices is unknown. The proportions of individuals with each of the choices are of interest because these proportions can give information about which source is mostly used by the farmers. However, the analyses of such survey data are complex because an individual is allowed to make at least one choice, the number of individuals with none of these choices is unknown or not reported, and the categorical table with mutually exclusive categories can be sparse. We use a simple Bayesian product multinomial-Dirichlet model to fit the count data both within and across education levels. We estimate the proportions of individuals with each choice, show how to select the best choice, and show using the Bayes factor how to test that these proportions are the same over different levels of farmers’ education. Our Bayesian procedure is simple, and essentially uses a sampling based method with independent samples, not dependent samples as in a Markov chain.