hw08.pdf - hw08_master November 8, 2019 1 Homework 8:...

This preview shows page 1 - 3 out of 9 pages.

hw08_masterNovember 8, 20191Homework 8: Confidence IntervalsReading: *EstimationPlease complete this notebook by filling in the cells provided.Before you begin, execute thefollowing cell to load the provided tests. Each time you start your server, you will need to executethis cell again to load the tests.Homework 8 is dueThursday, 10/31 at 11:59pm. You will receive an early submission bonuspoint if you turn in your final submission by Wednesday, 10/30 at 11:59pm. Start early so thatyou can come to office hours if you’re stuck. Check the website for the office hours schedule. Latework will not be accepted as per thepoliciesof this course.Directly sharing answers is not okay, but discussing problems with the course staff or with otherstudents is encouraged. Refer to the policies page to learn more about how to learn cooperatively.For all problems that you must write our explanations and sentences for, youmustprovide youranswer in the designated space. Moreover, throughout this homework and all future ones, please besure to not re-assign variables throughout the notebook! For example, if you usemax_temperaturein your answer to one question, do not reassign it later on.[ ]:# Don't change this cell; just run it.importnumpyasnpfromdatascienceimport*# These lines do some fancy plotting magic.importmatplotlib%matplotlibinlineimportmatplotlib.pyplotaspltplt.style.use('fivethirtyeight')importwarningswarnings.simplefilter('ignore',FutureWarning)fromclient.api.notebookimportNotebookok=Notebook('hw08.ok')1
1.11. Plot the VoteFour candidates are running for President of Dataland.A polling company surveys 1000 peopleselected uniformly at random from among voters in Dataland, and it asks each one who they areplanning on voting for.After compiling the results, the polling company releases the followingproportions from their sample:CandidateProportionCandidate C0.47Candidate T0.38Candidate J0.08Candidate S0.03Undecided0.04These proportions represent a uniform random sample of the population of Dataland.We willattempt to estimate the correspondingparameters, or the proportion of the votes that each candi-date will receive from the entire population. We will use confidence intervals to compute a rangeof values that reflects the uncertainty of our estimates.The tablevotescontains the results of the survey. Candidates are represented by their initials.Undecided voters are denoted byU.[14]:votes=Table.read_table('votes.csv')num_votes=votes.num_rowsvotes[14]:voteCJCSJJTCTC… (990 rows omitted)Question 1.Complete the functionone_resampled_proportionbelow. It should return Candi-date C’s proportion of votes after simulating one bootstrap sample oftbl.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 9 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Statistical hypothesis testing

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture