6.6 Assignment 6Due date: March 4, 2021 at 11:55 pm.
Be sure to use version control IntroductionWe are often interested in studying the relationship among variables to determine whether there is any underlying association among them. When we think that changes in a variable X explain, or maybe even cause, changes in a second variable Y, we call X an independent (or explanatory) variable and Y a dependent (or response) variable. Moreover, if we plot these variables (X,Y), and the form of the plot resembles a straight line, this may indicate that there may be a linear relationship between the two variables. The relationship is strong if all the data points are close to the line or weak if the points are widely scattered about the line. The covariance and correlation are measures of the strength and direction of a linear relationship between two quantitative variables. A regression line can be defined as a mathematical model describing a relationship between an explanatory variable X, and a response variable Y. The following are some steps that you should initially follow when analyzing data, and that you should also perform for this assignment:
Consider the Bike Sharing data set, a description of which can be found here. Download this data set and place it in your assignment directory. For the rest of this assignment, use the "day.csv" file, which contains daily data. Use the "temp" (the temperature of that day) as the independent variable, and "cnt" (the number of bikes used) as the dependent variable. Note that the dependent variable is not continuous. ProblemFor answering the following questions, create an R script, named We also want you to implement defensive programming, so that if the arguments are not a 1, 2 or 3, the script sends a message to the screen letting the user know that only these options are possible, and then stops. It should also check to make sure that there is only one command linear argument given. In addition to the commands in your script, include additional comments explaining your observations. 0) Create a function which loads the observations above, and puts them into an appropriate data structure, and then returns the data structure. Your script should perform the following actions:
1) If the command line argument is 1:
2) The following actions should be performed if the command line argument is 2:
3) The following actions should be performed if the command line argument is a 3: Some notes to follow when implementing your script: OBSERVATION #1: Do not use global variables, i.e. pass arguments to the functions you created otherwise you will lose marks!
OBSERVATION #2: You will notice that when running the R script from the command line, the plots will not be shown, but instead saved on a file named Examples:
Submit your
To capture the output of Assignments will be graded on a 10 point basis. Due date is March 4, 2021 at 11:55pm, with 0.5 point penalty per day for late submission until the cut-off date of March 11, 2021 at 11:00am.
Last Modified: Wednesday Mar 3, 2021 - 15:28. Revision: 9. Release Date: Thursday Feb 25, 2021 - 11:00.
|
|
Questions? Contact Support.
Web site engine's code is copyright © ATutor®. Modifications and code of added modules are copyright of SciNet. |