Question: I would like someone to review my R code for question 5 . The number of rows and columns with body part names is the
I would like someone to review my R code for question The number of rows and columns with body part names is the only thing that prints for question and the data it prints is not referring the the Printed Results in question Rather its referring to my earlier data. I hope this makes sense
Here is my code:
r setup, includeFALSE
knitr::optschunk$setecho TRUE
r mydata
# We'll reload this each time.
libraryreadxl
# Read the Excel csv file into a data frame
mydata read.csvC:RICDATABody Measurements.csv
# Display the first few rows of the data frame
headmydata
# Using the headers in the data frame we can make a scatterplot
plotNeckcm ~ Weight..lb data mydata
# If the data is two columns like ours is then this gives the correlation matrix
# x vs x x vs y y vs x and y vs y
result cormydata
printresult
# This does the correlation test, th col vs nd col of our data
cor.testmydata mydata alternative "two.sided"
# mydata would be the first row of our data
# mydata would be the data item in the first row and second column
# lm stands for linear model and finds the y intercept and slope for the lobf
lmNeckcm ~ Weight..lb data mydata
# the next line adds the lobf to our scatterplot
ablinelmNeckcm ~ Weight..lb data mydata
# using the lobf to predict y values for given xs in the
# range of the observed xs
x
y x
printy
##Question
r
result cormydata
strongcorrelations whichabsresult arr.ind TRUE
strongcorrelations
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
