Sampling#
Democracy is the theory people know what they want and deserve to get it, good and hard. - H.L. Mencken
The Student Government elections are an excellent opportunity to put some of your newfound analytical tools to use. In this lab, you will design and perform several experiments to predict who will win president.
Preamble#
As you will soon discover in the Instructions, you will be assigned a partner for this lab. In the spirit of statistics and to put you in the right headspace for this lab, I will be using the following code snippet to randomly assign partners.
import random
names = [ "Larry", "Curly", "Moe", "Shemp"]
randomly_ordered_names = random.shuffle(names)
Note
Obviously, I will be using your real names in class.
Instructions#
You will complete the data collection portion of this project with a partner. You will work together to design a sampling technique and then perform the experiment. Since you are both using the same data, you should both have the same answers. However, you will turn in separate reports and receive separate grades.
Create a Python
.py
script namedLASTNAME_FIRSTNAME_project_four.py
in yourLinux Files
folder on your file system. You can do this by opening an IDLE session, creating a new file and then saving it. ReplaceLASTNAME
andFIRSTNAME
with your last and first name, respectively.Create four spreadsheet files named
simple_random.csv
,stratified.csv
,cluster.csv
andsystematic.csv
. Place all of these files inLinux Files
folder on your file system.Create a Python docstring at the very top of the
.py
script file. Keep all written answers in this area of the script.Review the sampling techniques found in TODO. Class notes for this seciton can be on the Sampling Techniques page.
Perform all exercises and answer all questions in the Project section. Label your script with comments as indicated in the instructions of each problem.
When you are done, zip your
.py
script and all of your.csv
files into a zip file namedLASTNAME_FIRSTNAME_project_nine.zip
Upload the zip file here to the Google Classroom Project Nine assignment.
Collecting Data#
Everyone in highschool is eligible to vote in the elections and the population is large enough for draw statistically significant samples. You should, in theory, be able to make a reasonable prediction about the the outcome of the Student Government elections.
In order to ensure the accuracy of your predictions, we w