Module 7 Assignment R Code: # Module 7 Assignment #1.1 #First define the data set required, I/O values x <- c(16, 17, 13, 18, 12, 14, 19, 11, 11, 10) y <- c(63, 81, 56, 91, 47, 57, 76, 72, 62, 48) #Then we must create the relationship (correlation) cor(x,y) #This value 0.728 that is in the console tells us a few things #This relationship is correlated and is increasing linearly #I may choose to plot these findings using plot() plot(x,y) #See the lower righthand window for a composite plot for this data, as the regression trednline would positively increase through the points #1.2 #This settion of code will get the value for the coefficients of the linear regression for this data Regression_model=lm(y~x) Regression_model$coefficients #2.1 #This problem will go over the aquisition of similar values with a different data set discharge <- c(3.600,1.800,3.333,2.283,4.533,2.883) waiting <- c(79,54,74,62,85,55) plot(discharge,waiting) #2.1 Regression_model_1=lm(waiting~discha...
Comments
Post a Comment