Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Correlation and Regression R Studio Computer Activities Activity 1: Bivariate Correlation The data in Table 5.9 represent the scores on two youth fitness measurements, PACERLAPS

Correlation and Regression R Studio Computer Activities

Activity 1: Bivariate Correlation

The data in Table 5.9 represent the scores on two youth fitness measurements, PACERLAPS and treadmill-determined VO2MAX, for 25 subjects. Enter or import the data and then perform the indicated operations.

Activity 1: R Studio Instructions Set up your RStudio workspace.

In the RStudio menu bar, click on File New File R Script. On the first line of the R Script (upper left pane of RStudio), type #Week 6. Enter the variable names (STUDENT, PACERLAPS, VO2MAX) and corresponding values found in Table 5.9 into a spreadsheet and create a csv file named pacer to be imported into R. (Alternatively you could import Table_5_9_Data from the textbook website). If you created the pacer file, now import it into R (see Chapter 3). You should see the pacer data frame listed under the Environment tab (upper right pane of RStudio). If you created the pacer file, generate a scatterplot of the data using the plot function and labeling the x and y axes: plot(pacer$PACERLAPS, pacer$VO2MAX, xlab="PACER Laps", ylab="VO2MAX") Note: If you imported Table_5_9_Data, you need to change pacer to Table_5_9_Data here and in the steps below. When youve finished typing, highlight the entire function youve just typed in and click on Run. You should now see the scatterplot displayed in the lower right pane of RStudio under the Plots tab. We can also add a fitted line (generated by the lm function) to the plot using the abline function: abline(lm(pacer$VO2MAX ~ pacer$PACERLAPS), col="red") When youve finished typing, highlight the entire abline function and click on Run. You should now see a red fitted line overlaid on the scatterplot. Enter the following RScript commands to obtain descriptive statistics to answer question 1. mean(pacer$PACERLAPS) mean(pacer$VO2MAX) sd(pacer$PACERLAPS) sd(pacer$VO2MAX) range(pacer$PACERLAPS) range(pacer$VO2MAX) Highlight the above 6 lines and click on Run. Use the following RScript commands to obtain the data to answer questions 2 through 5.

6. Next, run a Pearson correlation between PACERLAPS and VO2MAX. cor(pacer$PACERLAPS, pacer$VO2MAX, method="pearson") The Pearson correlation coefficient will be displayed.

7. To add an additional 5 PACERLAPS to each subject, you could do the following: pacer$PACERLAPS5 <- pacer$PACERLAPS + 5 When youve finished typing, highlight the entire function youve just typed in and click on Run. You should now have a new variable created in your pacer data set.

8. Run another Pearson correlation, this time using the new variable PACERLAPS5 and VO2MAX. cor(pacer$PACERLAPS5, pacer$VO2MAX, method="pearson")

9. To calculate z-scores for PACERLAPS and corrected PACER laps (PACERLAPS5) using scale function. pacer$PACERLAPSZ <- scale(pacer$PACERLAPS) pacer$PACERLAPS5Z <- scale(pacer$PACERLAPS5) Highlight what youve typed and click Run to execute.

Activity 1 Questions

1. What are the following statistics for each of the two tests? Mean, SD, range?

2. What is the correlation between PACERLAPS and VO2MAX? Briefly explain what this means. (Hint: notice the sign and magnitude)

3. What is the correlation between VO2MAX and the corrected PACERLAPS?

4. What does this tell you? What do you notice about the two sets of z-scores? Hint: RStudio users should look in the Environment pane.

5. What is the correlation between PACERLAPS and the corrected PACERLAPS (PACERLAPS5)? What does this and your z-scores tell you?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago