Correlating different variables

Hello,

I am trying to correlate multiple variables within a dataset.

The dataset I'm using is gayreshaped.csv.

https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/gayreshaped.csv

First, I filtered the "study" and "treatment" variables:

gayreshaped3 <- filter(gayreshaped, study == 2, treatment == "No Contact")

After that, I tried to correlate the "therm1", "therm2", "therm3" and "therm4" variables but I couldn't get a result.

I am trying to use this command but it is not working.

gayreshaped3therms12 <- cor(gayreshaped3$therm1, gayreshaped3$therm2, gayreshaped3$therm3,gayreshaped3$therm4, use = "pairwise.complete.obs")

It also gave me this error: "Error in match.arg(method) : 'arg' must be NULL or a character vector"

Is there another way to correlate them or to solve this NULL problem?

Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.