Question

In: Math

How do you solve this using R? The file "flow-occ.csv" contains data collected by loop detectors...

How do you solve this using R?

The file "flow-occ.csv" contains data collected by loop detectors at a particular location of eastbound Interstate 80 in Sacramento, California, from March 14-20, 2003. For each of three lanes, the flow (the number of cars) and the occupancy (the percentage of time a car was over the loop) were recorded in successive five-minute intervals. There were 1740 such five-minute intervals. Lane 1 is the farthest left lane, lane 2 is in the center, and lane 3 is the farthest right.

(a) For each station, plot flow and occupancy versus time. Explain the patterns you see. Can you deduce from the plots what the days of the week were?

(b) Compare the flows in the three lanes by making parallel boxplots. Which lane typically serves the most traffic?

(c) Examine the relationships of the flows in the three lanes by making scatterplots. Can you explain the patterns you see?

(d) Make histograms of the occupancies, varying the number of bins. What number of bins seems to give good representations for the shapes of the distributions? Are they any unusual features, and if so, how might they be explained?

(e) Make plots to support or refute the statement, "When one lane is congested, the others are, too."

Timestamp

Lane 1 Occ

Lane 1 Flow

Lane 2 Occ

Lane 2 Flow

Lane 3 Occ

Lane 3 Flow

03/14/2003 00:00:00

0.01

14

0.0186

27

0.0137

17

03/14/2003 00:05:00

0.0133

18

0.025

39

0.0187

25

03/14/2003 00:10:00

0.0088

12

0.018

30

0.0095

11

03/14/2003 00:15:00

0.0115

16

0.0203

33

0.0217

19

03/14/2003 00:20:00

0.0069

8

0.0178

25

0.0123

13

03/14/2003 00:25:00

0.0077

11

0.0151

24

0.0092

13

03/14/2003 00:30:00

0.0049

7

0.0153

22

0.0192

19

03/14/2003 00:35:00

0.007

10

0.0194

33

0.0156

17

03/14/2003 00:40:00

0.0082

12

0.0146

26

0.0166

13

03/14/2003 00:45:00

0.0074

11

0.0207

30

0.018

14

03/14/2003 00:50:00

0.0071

10

0.0135

22

0.0074

11

03/14/2003 00:55:00

0.0069

10

0.012

17

0.0147

12

03/14/2003 01:00:00

0.0011

2

0.0078

13

0.0118

10

03/14/2003 01:05:00

0.0038

5

0.0116

18

0.0202

11

...there is more data that can't fit

Solutions

Expert Solution

The Rcode and explanation is given below


Related Solutions

Using R program and with a For loop. Assuming a data set of 1000 observations and...
Using R program and with a For loop. Assuming a data set of 1000 observations and 10 predictors. How would one use a for loop to cycle through different proportions of training and test sizes. For example, 20% of data goes to training and 80% for test in first iteration. Each iteration adding another 10% to the training set. So first set= (20% train, 80% test), second set = (30% train, 70% test), third set= (40% train,60%test) and so on....
Download the file data.csv (comma separated text file) and read the data into R using the...
Download the file data.csv (comma separated text file) and read the data into R using the function read.csv(). Your data set consists of 100 measurements in Celsius of body temperatures from women and men. Use the function t.test() to answer the following questions. Do not assume that the variances are equal. Denote the mean body temperature of females and males by μFμF and μMμMrespectively. (a) Find the p-value for the test H0:μF=μMH0:μF=μM versus HA:μF≠μM.HA:μF≠μM. Answer (b) Are the body temperatures...
Please use R to solve part e and f The data file data2.txt gives a data...
Please use R to solve part e and f The data file data2.txt gives a data set with two variables x and y. The first column in the data set is just row numbers not useful for this question. (e) Use the Shapiro-Wilks test to test for Normality of the data. State your null and alternative hypotheses, p-value and conclusion. Use α = 0.05 (f) Apply the transformation y 0 = log(y) and run the regression on y 0 on...
Ask the user how many days that they collected gems. A loop you write should loop...
Ask the user how many days that they collected gems. A loop you write should loop how many days the user enters. If the user enters 5 days, then the loop should loop 5 times to collect the data from each day. So, each loop iteration represents a day. In each loop iteration, ask the user how many gems they collected that day. After the loop finishes gathering the data for each day, calculate the total and average gems collected....
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE (SHOW ANSWERS IN R MARKDOWN FORWAT WITH CODE AND ANSWERS) PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2...
Using c programming language How do you put data from a text file into a 2d...
Using c programming language How do you put data from a text file into a 2d array For example a text file with names and age: john 65 sam 34 joe 35 sarah 19 jason 18 max 14 kevin 50 pam 17 bailey 38 one 2d array should have all the names from the file and one 2d array should have all the ages and both arrays should be printed out separately and be 3x3
Please solve in R The data below were collected in petri dishes, with each dish having...
Please solve in R The data below were collected in petri dishes, with each dish having the given concentration of Cadmium Chloride (X) in solution, and the growth of algae cells in the was dish recorded after two weeks’ time. Input the data into R, creating a data frame. Provide me the commands you used and print your data frame to the screen and print it out to show me what it looks like. Then construct a scatter plot of...
How do I even begin to solve this using R statistical software? A random sample of...
How do I even begin to solve this using R statistical software? A random sample of eight pairs of twins was randomly assigned to treatment A or treatment B. The data are given in the following table: Twins 1 2 3 4 5 6 7 8 Treatment A 48.3 44.6 49.7 40.5 54.3 55.6 45.8 35.4 Treatment B 43.5 43.8 53.7 43.9 54.4 54.7 45.2 34.4 What is the p-value of the Wilcoxon signed-rank test? Is there any significant evidence...
How do I even begin to solve this using R? A random sample of eight pairs...
How do I even begin to solve this using R? A random sample of eight pairs of twins was randomly assigned to treatment A or treatment B. The data are given in the following table. Twins 1 2 3 4 5 6 7 8 Treatment A 48.3 44.6 49.7 40.5 54.3 55.6 45.8 35.4 Treatment B 43.5 43.8 53.7 43.9 54.4 54.7 45.2 34.4 What is the p-value of the Wilcoxon signed-rank test? Is there any significant evidence that the...
Please solve all of the question using R and do clarify the answers. Using the (SATGPA)...
Please solve all of the question using R and do clarify the answers. Using the (SATGPA) data set in (Stat2Data) package. Test by using ?= .01. 1) Create the following three variables and then print out all the six variables. A) Create new variable "SAT", which is the sum of (MathSAT) and (VerbalSAT). B) Create second new variable ("SATLevel"), and assign the value of( "SATLevel") as 1 when SAT<=1100, 2 when 1100<SAT<=1200, 3 when 1200<SAT<=1300, and 4 when SAT>1300. C)Create...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT