Stat 220 Worksheet 2
We will be using R for some of the problems in this worksheet. The steps to get started are:
Download the SPD2020.csv data file (if you have not already done so), and the new SamplingWS2.R file that are posted with the assignment. Make sure to put both files in the same folder. We will refer to line numbers in the SamplingWS2.R file for some of the problems.
Set your working directory (Session > Set Working Directory…) to the directory that contains the .csv and .R files.
Run lines 4 – 14 of the SamplingWS2.R file to get the data read in and set up.
Unless otherwise specified, you can copy and paste output from R provided that you change the font of the R output to Courier New or Monaco. For example, the output from line 11 is,
E N S SW W
12245 26497 9918 7603 18362
After changing to Courier New you get,
E N S SW W 12245 26497 9918 7603 18362
Notice that the labels are still not aligned with the numeric output. After moving the E to align with the 5 in 12245, you get easy to read output as shown below.
E N S SW W
12245 26497 9918 7603 18362
Assignment
Complete the following problems.
Record the population percentages in each of the five precincts (output from line 13).
Change the 1500 on line 19 to 150. Then run lines 19 – 22 five times to draw five different simple random samples, each time recording the sample values for the percentages in each of the five precincts. Do the five samples give the exact same percentages across precincts? If no, do you need to be concerned about your samples? Explain.
Many analysis methods require independent samples. The simple random samples drawn in (2) above were drawn without replacement. Do we need to be concerned about dependence in our samples? Explain.
Run line 15 and find the population percentage of 2020 Shoplifting in Settle. Put your answer in a sentence.
Run lines 19 – 24 five times and report the percentages for shoplifting for each of the five samples (from line 24). How do you explain the variation in the percentage of shoplifting among the samples?
Calculate the margin of error for your estimated percentages in number (5) above.
Use the margin of error in number (6) above to calculate a lower and upper bound for the first shoplifting estimate in (5) above (Observed percentage – ME%, Observed percentage + ME%). If your lower bound is a negative percentage, change the lower bound to zero—the percentage of shoplifting cannot be smaller than zero. How confident are you in your 2020 shoplifting estimate?
Is the true percentage of reported 2020 shoplifting in Seattle from (4) above contained in the interval you calculated in part (7) above?
Rerun lines 17 – 22 just once after changing the sample size back to 1500. Record your 2020 shoplifting estimate, calculate the ME and lower and upper bounds for this sample.
How does the interval you calculated in (7) above, based on a sample size of 150, compare with the interval you calculated in (9) above, based on a sample size of 1500? Just compare and contrast the two intervals.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme