Here is data for the past week (Monday to Sunday) on how many hours I slept the previous night, what I had for breakfast, and how many minutes it took me to run over the bridge that day.

statistics

Description

1. Every morning I eat breakfast and then run over the Queensboro Bridge (1.33 miles). Here is data for the past week (Monday to Sunday) on how many hours I slept the previous night, what I had for breakfast, and how many minutes it took me to run over the bridge that day.


(a) Create four vectors 

i. One named daysofweek which contains the names of the days of the week. First element, for example, is Monday. 

ii. One named hoursslept which contains the number of hours I slept the previous night. First element, for example, is 8.

 iii. One named breakfast which contains the type of breakfast I ate that day. First element, for example, is oatmeal. 

iv. One named runtime which contains the minutes it took me to run. First element, for example, is 11. 


(b) From the vectors you have created above: 

i. create a vector firstdaysbfasts which contains the breakfasts I ate on the first three days of the week. 

ii. create a vector lastdaysbfasts which contains the breakfasts I ate on the last four days of the week. 

iii. create a vector wellfedruntimes which contains my run times on days on which I ate oatmeal for breakfast. It is NOT enough to say “give me the first and sixth element of runtime”. Your code must work no matter what the elements of runtime and breakfast are. 

iv. create a vector restedruntimes which contains my run times on days on which I slept more than 7 hours. 

v. create a vector wellfedandrestedruntimes which contains my run times on days on which I ate oatmeal for breakfast and slept more than 7 hours.

Instruction Files
week1.pdf
69.5 KB

Related Questions in statistics category