Download the ‘amis’ dataset from https://vincentarelbundock.github.io/Rdatasets/datasets.html and read it into R.
The ‘amis’ dataset contains speeding data from a study run by the Cambridgeshire County Council. The study investigated the effect that warning signs had on reducing vehicles’ speed. Speed was recorded at 14 locations (pairs).The dataset is structured as follows:
speed. Speeds of cars (in miles per hour).
period. a numeric column indicating the time that the reading was taken: 1 indicates a reading before the sign was erected; 2 indicates a reading taken shortly after erection of the sign; 3 indicates a reading taken after the sign had been in place for some time.
warning - # A numeric column indicating whether the location of the reading was chosen to have a warning sign erected.
Pair: It indicates the location where the reading was taken. Pairs were numbered from 1 to 14.
More information about the dataset is available at https://stat.ethz.ch/R-manual/R-devel/library/boot/html/amis.html
Calculate grand average, stdev, sterror of speed at periods 1, 2, and 3. In doing so, only consider the speeds recorded at locations where a sign was erected.
Your output should look similar to the one below:
Plot average speed for the three periods (1, 2, 3) at pairs 1 through 14.
Your output should look similar to the one below:
Create a new column normPair that has normalized speeds.Use speed recorded at pair 1 to normalize the speed recorded at pairs 2-14. Use the normalized speeds to create a plot as in task 3.
Your output should look similar to the one below:
Assuming that period is a within-subject variable, run appropriate statistics to find out whether the presence of a sign had an effect on average speed across the locations.
Using your dataset and the information available at https://ggplot2.tidyverse.org/reference/geom_linerange.html create a plot similar to the one that you created in task 3 that has error bars. Use standard error for error bars.
Your output should look similar to the one below: