Introduction to Statistics (MAT/SST 115.03 2008S)
This activity requires a bit more work with R than we've done in previous exercises. We start by reading in values.
SeatBeltUsage = read.csv("/home/rebelsky/Stats115/Data/SeatBeltUsage05.csv")
The first step is to separate the table into two parts.
Primary = SeatBeltUsage[SeatBeltUsage$LawType == "Primary", ] Secondary = SeatBeltUsage[SeatBeltUsage$LawType == "Secondary", ]
You will need to extract the
column from each in order to compute dot plots, means, and medians.
It may be helpful to draw each dot plot in a separate window.
In R, the way we create a new output window depends on the
computer system we're using. On Linux (which we use in class),
the command is
X11(). On a Mac, the command is
quartz(). On Microsoft windows, the command is
windows(). Hence, on our Linux boxes, you might
create new windows for the two new plots with.
X11() dotPlot(Primary$CompliancePercentage) X11() dotPlot(Secondary$CompliancePercentage)
Copyright (c) 2007-8 Samuel A. Rebelsky.
This work is licensed under a Creative Commons
Attribution-NonCommercial 2.5 License. To view a copy of this
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.