Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cor.test

Alternative formula interface for cor.test


Description

stats::cor.test() in stats accepts formulas of the shape ~ y + x. The mosaic package allows the use of y ~ x as an alternative formula shape.

Usage

## S3 method for class 'formula'
cor_test(formula, ...)

cor.test(x, ...)

cor_test(x, ...)

## Default S3 method:
cor_test(x, y, ...)

Arguments

formula

a formula

...

other arguments passed to stats::cor.test().

x, y

numeric vectors of data values. x and y must have the same length.

See Also

stats::cor.test() in the stats package.

Examples

# This is an example from example(stats::cor.test) done in old and new style
require(graphics)
cor.test(~ CONT + INTG, data = USJudgeRatings)
cor.test(CONT ~ INTG, data = USJudgeRatings)

mosaic

Project MOSAIC Statistics and Mathematics Teaching Utilities

v1.8.3
GPL (>= 2)
Authors
Randall Pruim [aut, cre], Daniel T. Kaplan [aut], Nicholas J. Horton [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.