Question: I need help with a IDS Lab 4C Load_Lab(26) In R script Studio This is what Ive done so far lmk if u need any
I need help with a IDS Lab 4C
Load_Lab(26) In R script Studio
This is what Ive done so far lmk if u need any other info add and finish it
load_lab(26) #Split the arms_pan dataset into 2 subsets(training and text) #Create another dataset from arm_span with the remaining 5 rows test<-slice(arm_span,~training_rows) #Fit a LSRL to training, call it best_training best_training<-1m(height,~armspan,data=training) #Create an xyplot of training with the line of best fit xyplot(height~armspan,data=training,main="Height and Armspan for the Training Set") add_line(Intercept=19.7203950,slope=0.6968428,col=chartrouse) #Calculate the training MSE training<-subset(training,select=c(best_predicted_heights, best_residual)) training<-subset(training,select=~c(5)) #Calculate the training MSE training<-mutate(~training,predict(bes_training) training<-mutate(~training,errors=height-predicted_height) summarize(training,mean(errors)^2)) #Get rid of the extra collumn test<-subset(test,select=-c(6)) #Add the training line of best fit to the test syplot xyplot height~armspan,datautest,main="Height and Armspan for the test set") add _line() #Add an error colum test - mutate (test, errors-height-predicted_height) #scalculate the MSE for the test set summarize (test, mean (errors^2)) #The MSE for test 1s 3.52, which is WEIRD because it's < 4.51
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
