{"id":284,"date":"2007-01-22T08:30:00","date_gmt":"2007-01-22T08:30:00","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/01\/22\/basics-margin-of-error\/"},"modified":"2016-01-20T09:03:31","modified_gmt":"2016-01-20T14:03:31","slug":"basics-margin-of-error","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/01\/22\/basics-margin-of-error\/","title":{"rendered":"Basics: Margin of Error"},"content":{"rendered":"<p>The margin of error is <em>the<\/em> most widely misunderstood and misleading concept in statistics. It&#8217;s positively frightening to people who actually understand what it means to see how it&#8217;s commonly used in the media, in conversation, sometimes even by other scientists!<\/p>\n<p> The basic idea of it is very simple. Most of the time when we&#8217;re doing statistics, we&#8217;re doing statistics based on a sample &#8211; that is, the entire population we&#8217;re interested in is difficult to study; so what we try to do is pick a <em>representative subset<\/em> called a sample. If the subset is <em>truly<\/em> representative, then the statistics you generate using information gathered from the sample will be <em>the same<\/em> as information gathered from the population as a whole.<\/p>\n<p> But life is never simple. We <em>never<\/em> have perfectly representative samples; in fact, it&#8217;s <em>impossible<\/em> to select a perfectly representative sample. So we do our best to pick good samples, and we use probability theory to work out a predication of how confident we can be that the statistics from our sample are representative of the entire population. That&#8217;s basically what the margin of error represents: how well we <em>think<\/em> that the selected sample will allow us to predict things about the entire population. <\/p>\n<p><!--more--><\/p>\n<p> The way that we compute a margin of error consists of a couple of factors:<\/p>\n<ol>\n<li> The <em>size<\/em> of the sample.\n<li> Magnitude of <em>known<\/em> problems in the sample.\n<li> The <em>extremity<\/em> of the statistic.\n<\/ol>\n<p> Let&#8217;s look at each of those in a bit more detail to understand what they mean, and then I&#8217;ll explain how we use them to compute a margin of error.<\/p>\n<p> The larger a sample is, the more likely it is to be representative. The intuition behind that is pretty simple: the more individuals that we include in the sample, the less likely we are to accidentally omit some group or some trend that exists within the population. Taking a presidential election as an example: if you polled 10 randomly selected people in Manhattan, you&#8217;d probably get mostly democrats, and a few republicans. But Manhattan actually has a fairly sizeable group of people who vote for independents, like the green party. If you sampled 100 people, you&#8217;d probably get at least three or four greens. With the smaller sample size, you&#8217;d wind up with statistics that <em>overstated<\/em> the number of democrats in Manhattan, because the green voters, who tend to be very liberal,  would probably be &#8220;hidden&#8221; inside of the democratic stat. If you sampled 1000 people, you&#8217;d be more likely to get a really good picture of NYC: you&#8217;d get the democrats and republicans, the conservative party, the working families party, and so on &#8211; all groups that you&#8217;d miss in the smallest sample.<\/p>\n<p> When we start to look at a statistic, we start with an <em>expectation<\/em>: a very rough sense of what the outcome is likely to be. (Given a complete unknown, we generally start with the Bayesian assumption that in the presence of zero knowledge, you can generally assign a 50\/50 split as an initial guess about the division of any population into exactly two categories.) When we work with a sample, we tend to be <em>less<\/em> confident about how representative that sample is the farther the measured statistic varies from the <em>expected<\/em> value.<\/p>\n<p> Finally, sometimes we <em>know<\/em> that the mechanism we use for our sample is imperfect &#8211; that is, we know that our sample contains an unavoidable bias. In that case, we expand the margin of error to try to represent the reduced certainty caused by the known bias. For example, in elections, we know that <em>in general<\/em>, there are certain groups of people who simply <em>are less likely<\/em> to participate in exit polls. An exit poll simple <em>cannot<\/em> generate an unbiased sample, because the outcome is partially determined by <em>who<\/em> is willing to stop and take the poll. Another example is in polls involving things like sexuality, where because of social factors, people are <em>less likely<\/em> to admit to certain things. If you&#8217;re trying to measure something like &#8220;What percentage of people have had extramarital affairs?&#8221;, you <em>know<\/em> that many people are not going to tell the truth &#8211; so your result will include an expected bias.<\/p>\n<p> Given those, how do we compute the margin of error? It depends a bit on how you&#8217;re measuring. The easiest (and most common) case is a <em>percentage<\/em> based statistic, so that&#8217;s what we&#8217;ll stick with for this article. The margin of error is computed from the <em>standard error<\/em>, which is in turn derived from an <em>approximation<\/em> of the standard deviation. Given a population of size P; and a measured statistic of X (where X is in decimal form &#8211; so 50% means X=0.5), the standard error E is:<\/p>\n<p>&lt;!&#8211; Insert image for equation: E = ((X * (1-X))\/P)<sup>1\/2<\/sup> &#8211;&gt;<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"margin-of-error.jpg\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_137.jpg?resize=125%2C35\" width=\"125\" height=\"35\" \/><\/p>\n<p> The way that equation is generated is beyond the scope of this &#8211; but it&#8217;s built on a couple of reasonable assumptions: the big one being that the statistic being measured has a <em>binomial<\/em> distribution. (For now, think of a binomial distribution as being something where randomly selected samples will generate results for a statistic that form a bell curve around the value that you would get if you could measure the statistic for the <em>entire<\/em> population.) If you make that assumption, we wind up with an equation in terms of the <em>variance<\/em> of the population (the variance is the standard deviation squared) &#8211; and then with a couple of simplifications that can be shown to not significantly alter the value of the standard standard error, we wind up with that equation. <\/p>\n<p>To get from the standard error to the margin of error, we need to pick a <em>confidence interval<\/em>. A confidence interval is a percentage representing how certain we are that the actual statistic lies within the measured statistic +\/- the margin of error. <em>In general<\/em>, most statistics are computed using a confidence interval of 95%. You get a confidence interval of 95% when you use twice the standard error as your margin of error. So the margin of error for most polls is 2E with a confidence of 95%. Using 2.58E as your margin of error gives you a confidence interval of 99%; using just 1E gives you a confidence interval of 68%.<\/p>\n<p> There are a bunch of errors in how people generally use the margin of error:<\/p>\n<ol>\n<li> The most glaring error is not citing the confidence interval. You <em>cannot<\/em> know what a margin of error means if the confidence interval isn&#8217;t specified. I don&#8217;t think I can remember the last time I saw a CI quoted outside of a scientific paper.<\/li>\n<li> Many people, especially journalists, believe that the margin of error includes <em>all possible sources of error<\/em>. It most emphatically does not &#8211; it <em>only<\/em> specifies the magnitude of error introduced by <em>non-deliberate sampling errors<\/em>. In a scientific experiment, experimental errors and measurement errors always affect the outcome of the experiment &#8211; but the margin of error <em>does not<\/em> include those factors &#8211; only the sampling error. In a poll, the wording of a question and the way in which its asked have a <em>huge<\/em> impact &#8211; and that is <em>not<\/em> part of the margin of error. (For example, if you wanted to measure support for concealed carry laws for guns, you could ask people &#8220;Do you believe that people should be allowed to carry concealed weapons anywhere they go, including government buildings, schools, and churches?&#8221;, you&#8217;d get one result. If you asked &#8220;Do you believe that citizens have a right to carry a weapon to protect themselves and their families from criminals?&#8221;, you&#8217;d get a very different answer &#8211; the phrasing of the first question is likely to bias people <em>against<\/em> saying yes, by deliberately invoking the image of guns in a school or a church. The phrasing of the second question is likely to generate far more &#8220;Yes&#8221; answers than the first, because it invokes the image of self-protection from rampaging bad-guys.)<\/li>\n<li> People frequently believe that the margin of error is a measure of the <em>quality<\/em> of a statistic &#8211; that is, that a well-designed poll will have a smaller margin of error than a poorly-designed poll. It doesn&#8217;t &#8211; the MoE <em>only<\/em> represents sampling errors! A <em>great<\/em> poll with a sample size of 100 will virtually always have a considerably larger MoE than a <em>terrible<\/em> poll with a sample size of 1000. If you want to know the quality of a poll, you need to know more information it than just the margin of error; If you want to gauge the relative quality of two different polls, you need to know more than just the margin of error. In either case, you really need to know the sample size, how the sample was collected, and <em>most importantly<\/em> exactly what they measure.\n<p> To give another political example, there are a number of different polls taken on a very regular basis of the approval ratings of the president. These polls vary quite drastically &#8211; for example, <a href=\"http:\/\/www.pollingreport.com\/BushJob1.htm\">in this week&#8217;s polls<\/a>, the number of people who approve of the president range from 30% to 39%, with margins of error in the 3% range.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The margin of error is the most widely misunderstood and misleading concept in statistics. It&#8217;s positively frightening to people who actually understand what it means to see how it&#8217;s commonly used in the media, in conversation, sometimes even by other scientists! The basic idea of it is very simple. Most of the time when we&#8217;re [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[74],"tags":[],"class_list":["post-284","post","type-post","status-publish","format-standard","hentry","category-basics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-4A","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=284"}],"version-history":[{"count":2,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/284\/revisions"}],"predecessor-version":[{"id":3256,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/284\/revisions\/3256"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}