{"id":52659,"date":"2024-04-26T23:31:20","date_gmt":"2024-04-26T23:31:20","guid":{"rendered":"http:\/\/localhost\/branding\/midterm\/"},"modified":"2024-04-26T23:31:20","modified_gmt":"2024-04-26T23:31:20","slug":"midterm","status":"publish","type":"post","link":"https:\/\/sheilathewriter.com\/blog\/midterm\/","title":{"rendered":"Midterm"},"content":{"rendered":"<p>Midterm<\/p>\n<p>Morgan Holland<\/p>\n<p>5\/22\/2020<\/p>\n<p>Instructions<\/p>\n<p>You will need alcohol. RData dataset to complete the Midterm.<\/p>\n<p>The dataset includes data on 9,822 individuals. Each individual report various demographic and health characteristics, as well as a variable that equals 1 if the person reports abusing alcohol.<\/p>\n<p>Question 1.<\/p>\n<p>Load the alcohol.RData dataset. Convert it to a table named \u201calcohol.\u201d Use print(head(alcohol)) to show me the first six rows of the dataset. Copy and paste your code and output into the answer box.<\/p>\n<p>Print(head(alcohol))<\/p>\n<p>Question 2<\/p>\n<p>unemrate is the unemployment rate in a respondent\u2019s State. At what level of measurement is this variable? (Nominal Scale, Ordinal Scale, Interval Scale, or Ratio Scale)?<\/p>\n<p>Ratio scale since it has a defined zero point.<\/p>\n<p>Question 3-6<\/p>\n<p>The famsize variable measures how many people are in the respondent\u2019s family. Fill in the missing values in the following relative frequency table: <\/p>\n<p>Family Size      Number of Respondents        Relative Frequency       Cumulative Relative Frequency <\/p>\n<p>1  2595  0.264  0.264 <\/p>\n<p>2  2311  0.235  0.499 <\/p>\n<p>3  1766  0.180  0.679 <\/p>\n<p>4  2000  0.204  0.883 <\/p>\n<p>5  740  0.075  0.958 <\/p>\n<p>6  257  0.026  0.984 <\/p>\n<p>7  99  0.010  0.995 <\/p>\n<p>8  32  0.003  0.998 <\/p>\n<p>9  9  0.001  0.999 <\/p>\n<p>10  6  0.001  0.999 <\/p>\n<p>11  5  0.001  1.000 <\/p>\n<p>12  1  0.000  1.000 <\/p>\n<p>13  1  0.000  1.000 <\/p>\n<p>Total number of respondents = 9822<\/p>\n<p> Family size 2: 2311\/9822 = 0.235<\/p>\n<p> Family size 4: 2000\/9822 = 0.204<\/p>\n<p>Cumulative Relative Frequency Family size 3: 0.499+0.180 = 0.679 <\/p>\n<p>Cumulative Relative Frequency Family size 3: 0.679+0.204 = 0.883<\/p>\n<p>Question 7-8f<\/p>\n<p>Create a barplot of the famsize variable Copy and paste your code in the answer box. In the next question, upload your barplot.<\/p>\n<p># Simple Bar Plotcounts &lt;- table(mtfamily$size)barplot (counts, main=&#8221;Number of Respondents&#8221;,\u00a0\u00a0 xlab=&#8221;Family Size&#8221;<\/p>\n<p>Question 9<\/p>\n<p>Does family size appear to be right-skewed, left-skewed, or not skewed at all?<\/p>\n<p>Family size appears to be left-skewed<\/p>\n<p>Question 10-11<\/p>\n<p>educ is the respondent\u2019s level of education, in years. Calculate the sample mean and sample standard deviation of educ.<\/p>\n<p>Sample mean = average (E2:E9823) = 13.30961<\/p>\n<p>Sample standard deviation =std. s (E2:E9823) = 2.898751<\/p>\n<p>Question 12<\/p>\n<p>Suppose we assume that unemrate is normally distributed with mean 5.57% and standard deviation 1.51%. What is the probability of picking a person at random who faces an unemployment rate less than 4%?<\/p>\n<p>\u00b5 = 0.0557 and \u03c3 = 0.0151<\/p>\n<p>P(x&lt;0.04) = P(x-\u00b5&lt;0.04-0.0557) = P (x-\u00b5\u03c3&lt;0.04-0.05570.0151)0.04-0.05570.0151= -1.04P(z&lt;-1.04) = 0.1492<\/p>\n<p>Question 13<\/p>\n<p>What is the probability of picking a person who faces an unemployment rate greater than 7%, assuming the unemployment rate is normally distributed as in question 12?<\/p>\n<p>\u00b5 = 0.0557 and \u03c3 = 0.0151<\/p>\n<p>P(x&gt;0.07) = P(x-\u00b5&gt;0.07-0.0557) = P (x-\u00b5\u03c3&gt;0.07-0.05570.0151)0.07-0.05570.0151= 0.95P(z&gt;0.95) = 0.1711<\/p>\n<p>Question 14<\/p>\n<p>What is the 98th percentile of unemrate, assuming it is normally distributed as in question 8?<\/p>\n<p>0.98 to z score <\/p>\n<p>Percentile to z score<\/p>\n<p>P(z&lt;?) = 0.98<\/p>\n<p>Z = 2.05<\/p>\n<p>2.05=x-0.05570.0151X = 2.05(0.0151) + 0.0557<\/p>\n<p>X = 0.0867 = 8.67%<\/p>\n<p>Question 15-16<\/p>\n<p>Now let\u2019s informally test our assumption that the unemployment rate is normally distributed.<\/p>\n<p>plot a histogram of unemrate, using a binwidth of 0.1. Copy and paste the code you used in the answer box. In the next question, upload your histogram as a .png or .jpeg<\/p>\n<p>Question 17<\/p>\n<p>Based on your histogram, do you think the unemployment rate is normally distributed? Justify your reasoning in 2-3 sentences.<\/p>\n<p>The graph is not normally distributed.<\/p>\n<p>The graph is nowhere close to the bell shape. It peaks at somewhere in the middle of the histogram and also further to the right.<\/p>\n<p>Question 18<\/p>\n<p>Suppose you are rolling a six-sided die. Let event A= {2,4,6} and B = {1,3,5}. True or False, these events are mutually exclusive.<\/p>\n<p>False. The two events can happen at the same time.<\/p>\n<p>Question 19<\/p>\n<p>Suppose you are rolling a six-sided die. Let event A= {2,3,4} and event B= {1,2,3}. What is the intersection of these two events? That is, what is A\u2229B?<\/p>\n<p>A\u2229B = {2,3}<\/p>\n<p>Question 20<\/p>\n<p>Suppose you are rolling a six-sided die. Let event A= {2,3,4} and event B= {1,2,3}. What is the union of these two events? That is, what is A\u222aB?<\/p>\n<p>A\u222aB = {1,2,3,4}<\/p>\n<p>Question 21<\/p>\n<p>Suppose you flip a biased coin two times. The probability of getting heads in this coin is p = 0.2. What is the probability of getting two heads in the two flips?<\/p>\n<p>Hint: There are two ways to solve this. You can use R\u2019s built-in Binomial distribution (type help(dbinom)) for more information) or you can write out each event and calculate the probability using the probability rules.<\/p>\n<p>Since the probability of getting heads in one toss\/flip = 0.2<\/p>\n<p>The probability of getting two heads on two-coin tosses\/flips = 0.2 x 0.2 (because these are independent events) = 0.04<\/p>\n<p>Thus, the answer is:\u00a00.04<\/p>\n<p>Question 22<\/p>\n<p>Suppose X is Bernoulli distributed with parameter p=0.8. What is the mean of X?<\/p>\n<p>Bernoulli distribution is a type of discrete probability distribution which have two possible outcomes where probability of x = 0(failure) is 1-p and probability of x = 1(success) is p.<\/p>\n<p>Mean = Summation xp(x) = 0 * (1-p) + 1 * (p) = p = 0.8<\/p>\n<p>Therefore, mean(x) = 0.8<\/p>\n<p>Question 23<\/p>\n<p>Suppose you know that the number of customers that arrive at a grocery store in an hour is a Poisson random variable with \u03bb=200 That is, you know that on average 200 customers enter the store every hour. On average, how many customers can you expect to arrive in the next ten minutes?<\/p>\n<p>Here \u03bb = 200\/hr<\/p>\n<p>Or, \u03bb = 2003 min=103Expected number of customers in the next minute = \u03bbt<\/p>\n<p>= 10310=1003=33 customers <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Midterm Morgan Holland 5\/22\/2020 Instructions You will need alcohol. RData dataset to complete the Midterm. The dataset includes data on<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-52659","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Midterm - sheilathewriter<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sheilathewriter.com\/blog\/midterm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Midterm - sheilathewriter\" \/>\n<meta property=\"og:description\" content=\"Midterm Morgan Holland 5\/22\/2020 Instructions You will need alcohol. RData dataset to complete the Midterm. The dataset includes data on\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sheilathewriter.com\/blog\/midterm\/\" \/>\n<meta property=\"og:site_name\" content=\"sheilathewriter\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-26T23:31:20+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/midterm\/\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/midterm\/\",\"name\":\"Midterm - sheilathewriter\",\"isPartOf\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\"},\"datePublished\":\"2024-04-26T23:31:20+00:00\",\"author\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\"},\"breadcrumb\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/midterm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sheilathewriter.com\/blog\/midterm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/midterm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sheilathewriter.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Midterm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/\",\"name\":\"sheilathewriter\",\"description\":\"Custom essay writing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/opskill.com\/propapers\"],\"url\":\"https:\/\/sheilathewriter.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Midterm - sheilathewriter","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sheilathewriter.com\/blog\/midterm\/","og_locale":"en_US","og_type":"article","og_title":"Midterm - sheilathewriter","og_description":"Midterm Morgan Holland 5\/22\/2020 Instructions You will need alcohol. RData dataset to complete the Midterm. The dataset includes data on","og_url":"https:\/\/sheilathewriter.com\/blog\/midterm\/","og_site_name":"sheilathewriter","article_published_time":"2024-04-26T23:31:20+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sheilathewriter.com\/blog\/midterm\/","url":"https:\/\/sheilathewriter.com\/blog\/midterm\/","name":"Midterm - sheilathewriter","isPartOf":{"@id":"https:\/\/sheilathewriter.com\/blog\/#website"},"datePublished":"2024-04-26T23:31:20+00:00","author":{"@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab"},"breadcrumb":{"@id":"https:\/\/sheilathewriter.com\/blog\/midterm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sheilathewriter.com\/blog\/midterm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sheilathewriter.com\/blog\/midterm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sheilathewriter.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Midterm"}]},{"@type":"WebSite","@id":"https:\/\/sheilathewriter.com\/blog\/#website","url":"https:\/\/sheilathewriter.com\/blog\/","name":"sheilathewriter","description":"Custom essay writing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/opskill.com\/propapers"],"url":"https:\/\/sheilathewriter.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/52659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/comments?post=52659"}],"version-history":[{"count":0,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/52659\/revisions"}],"wp:attachment":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/media?parent=52659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/categories?post=52659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/tags?post=52659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}