MulaiMulai sekarang secara gratis

Correlations output

In chapter 3, you computed the correlations between age and the four weight measurements using psych::corr.test(). However, the results were only displayed to the console.

In this exercise, you will save the output to an object named abcorr and then extract specific elements from that output including the p-values, so that you can display them with greater precision.

The abaloneKeep dataset, dplyr and psych packages have been loaded for you.

Latihan ini adalah bagian dari kursus

R For SAS Users

Lihat Kursus

Petunjuk latihan

  • Compute correlations between age, whole weight, shucked weight, shell weight, and viscera weight using psych::corr.test(). Save the output as abcorr.
  • Display the r and p elements from the abcorr output to review the Pearson's correlation coefficients and associated p-values.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Save correlation from psych::corr.test(), run str()
abcorr <- ___ %>% 
  ___ %>%
  ___

# Display Pearson's r's and p-values from abcorr
abcorr$___
abcorr$___
Edit dan Jalankan Kode