# Question about Bayesian Polling

A professor in the United States reads a headline stating that only 36% of Americans have ever been outside the U.S. She believes the headline to be true and would like to know whether the 30 pupils enrolled in her history class are more or less traveled than the average American. One day she conducts a poll and finds that 7 of the 14 students present that day have travelled abroad. How likely is it that more than 36% of her class has traveled internationally?

I am not sure of the best way of attacking this problem from a Bayesian perspective. Let's say, for arguments sake, that before running the pole, she believes that her students are a legitimate random sample of the American population so that the 36% number can be used to inform a prior.

The reason this problem is tricky to me is that it is asking a question about a finite population. Had she polled 29 of the 30 students and found that only 7 had traveled abroad, then there is a 0% probability that more than 36% of her class has international traveling experience.

As you say, as for all Bayesian inference, the answer depends on the prior distribution. It also relies on having data randomly selected from whatever population is of interest. I think we may be on squishy ground in this problem on both accounts.

If the newspaper poll claimed a 95% margin of error of around $$\pm 0.03$$ and the professor believes her students are reasonably representative of the US population, then she may choose the prior distribution $$\theta \sim \mathsf{Beta}(72,128),$$ for the proportion $$\theta$$ who have traveled abroad. This prior distribution has mean about 0.36, standard deviation about 0.33, and probability about 95% in the interval $$(0.295, 0.428).$$ The density function is proportional to $$\theta^{72-1}(1-\theta)^{128-1}.$$ Computation from R:

qbeta(c(.025,.975), 72, 128)
[1] 0.2950489 0.4276035


Intrinsically, this prior distribution also implies that $$P(\theta > .36) \approx 1/2.$$

1 - pbeta(.36, 72, 128)
[1] 0.4945107


Then, regarding her class as an appropriate sample from the US population, suppose she sees 7 out of 14 who have traveled abroad, so her binomial likelihood function is proportional to $$\theta^7(1-\theta)^7.$$

The posterior beta distribution has a density which is proportional to the product of the prior and the likelihood: $$\theta^{79-1}(1-\theta)^{135-1},$$ which we recognize as the kernel of $$\mathsf{Beta}(79, 135).$$

It follows that a 95% Bayesian credible interval estimate of $$\theta$$ is is approximately $$(0.306, 0.435).$$

qbeta(c(.025, .975), 79, 135)
[1] 0.3058837 0.4347508


The posterior probability $$P(\theta > .36) \approx 0.605.$$

1 - pbeta(.36, 79, 135)
[1] 0.6048508


In this case the information in the prior distribution, based in a poll of perhaps about a thousand US residents, has overwhelmed the information from 14 students in the professor's class. Even though their influence on the result has been modest, it is fair to ask whether 14 non-randomly chosen students should have had any influence at all in an assessment of the traveling habits of Americans in general.

Using an noninformative Jeffries prior distribution $$\mathsf{Beta}(.5, .5)$$ that carries little or no information, the professor would obtain a 95% Bayesian credible interval estimate of $$\theta,$$ based on the responses of her 14 students: $$(0.259, 0.741).$$ And $$P(\theta > 0.36) \approx 0.86.$$

qbeta(c(.025,.975), 7.5, 7.5)
[1] 0.258927 0.741073
1 - pbeta(.36, 7.5, 7.5)
[1] 0.8618112


Before doing these computations, the professor should make it clear from what population she believes 14 students, who happened to attend her class on a particular day, may rightfully be considered a random sample.

• Thank you for the detailed solution -- very similar to my first crack at it. Here's what bothers me. This model (with Jeffiries prior) says there is roughly a 1% chance that the fraction of students who have traveled is less than 22%. But we know this is impossible. We know 7 students have traveled meaning that the fraction will definitely be above 23.3%. Would it be a valid approach to model $\theta$ as a beta distribution, but then MCMC a binomial based on $\theta$ to get counts from which to estimate the answer? Aug 27 '19 at 13:46
• Also. I have a followup question regarding assigning priors. The headline stated that 36% of Americans have traveled abroad, but makes no comment about the uncertainty on that number. Would it make sense to model the prior with a beta distribution having roughly that proportion, but having pseudo-observations reflecting the actual number of students in the class? So, for example, would it makes sense to use $\theta \sim Beta\left(11 + 1, 19 + 1\right)$ as a prior? Aug 27 '19 at 13:55
• Most polls that get published have around $n = 1100$ subjects for a margin of error about $\pm 0.03$ or around $n = 2500$ for a margin of error about $\pm 0.02.$ Roughly, the 95% margin of error is $\pm 1/\sqrt{n},$ for large $n.$ (Some early-season political popularity polls use as few as $n = 400.$) So one 'reasonable' choice of prior would assume $\pm 0.03.$ // Presumably the poll in the newspaper was independent of the professor's class. Many college students have the means and enthusiasm for some travel, so they may not be typical of the general US population. So what prior for them?? Aug 27 '19 at 17:38
• As to your earlier comment, you have to decide whether the class of 30 or the group of 14 who made it to class is a sample or a population. There seems no good choice. Thus the 1st paragraph of my Answer. Aug 27 '19 at 17:45