Question 4 does the convenience sample give us an

This preview shows page 25 - 29 out of 34 pages.

Question 4.Does the convenience sample give us an accurate picture of the salary of the full population?Would you expect it to, in general? Before you move on, write a short answer in English below. You can referto the statistics calculated above or perform your own analysis.
2/24/19, 11(55 PMlab05_masterPage 26 of 34Simple random samplingA more justifiable approach is to sample uniformly at random from the players. In asimple random sample(SRS) without replacement, we ensure that each player is selected at most once. Imagine writing downeach player's name on a card, putting the cards in an box, and shuffling the box. Then, pull out cards one byone and set them aside, stopping when the specified sample size is reached.Producing simple random samplesSometimes, it’s useful to take random samples even when we have the data for the whole population. Ithelps us understand sampling accuracy.sampleThe table methodsampleproduces a random sample from the table. By default, it draws at randomwithreplacementfrom the rows of a table. It takes in the sample size as its argument and returns atablewithonly the rows that were selected. The optional argumentwith_replacement=Falsespecifies that thesample should be drawn without replacement.Run the cell below to see an example call.In [40]:# Just run this cellsalary_data.sample(5, with_replacement=False)Question 5.Produce a simple random sample of size 44 fromfull_data. Run your analysis on it again.Run the cell a few times to see how the histograms and statistics change across different samples.How much does the average age change across samples?What about average salary?Out[40]:PlayerNameSalaryBrook Lopez15719063Jimmer Fredette948163Danny Granger2077000Miles Plumlee1169880Danny Green4025000
2/24/19, 11(55 PMlab05_master)
Page 27 of 34
2/24/19, 11(55 PMlab05_masterPage 28 of 34

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 34 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Pride and Prejudice, Simple random sample

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture