powered by
This function simplifies the call for Pearson's Product-Moment Correlation Coefficient (p.corr) on a given data frame.
p.corr(df, var1, var2)
This function returns the summary results table for a Pearson's correlation, examining the relationship between var1 from data frame df, and var2.
var1
df
var2
data frame to read in.
the dependent/outcome variable, \(Y\).
the main independent/predictor variable, \(X\).
data <- mtcars p.corr(data,mpg,wt)
Run the code above in your browser using DataLab