twosample.cor.test: Comparing statistically two correlation coefficients

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/twosample.cor.test.R

Description

Test of the equality of two correlation coefficients

Usage

1
2
twosample.cor.test(x1, y1, x2, y2, alpha = 0.05,alternative =
c("two.sided", "less", "greater"))

Arguments

x1

x1 is a numeric vector associated to y1

y1

y1 is a numeric vector associated to x1

x2

x2 is a numeric vector associated to y2

y2

y2 is a numeric vector associated to x2

alpha

significance level of the test

alternative

Alternative hypothesis for the test. Either two sided ("two.sided"), one sided to the left ("less") or one sided to the right ("greater"). Default is "two.sided".

Value

Returns a list:

statistic

Value of the test statistic

p.value

p-value of the test

Author(s)

Lafaye de Micheaux Pierre <lafaye@unsw.edu.au>, Remy Drouilhet <Remy.Drouilhet@upmf-grenoble.fr>, Liquet Benoit <b.liquet@uq.edu.au>

References

Chapter 13 (Confidence Intervals and Hypothesis Testing) from the book: The R Software, Fundamentals of Programming and Statistical Analysis

See Also

cor0.test

Examples

1
2
3
4
5
6
7
data(BMI.CHILD)
attach(BMI.CHILD)
indf <- which(GENDER=="F")  # To  retrieve indices of the females.
indm <- which(GENDER=="M")  # To retrieve indices of the males.
twosample.cor.test(height[indf],weight[indf],
                   height[indm],weight[indm])
detach(BMI.CHILD)

Example output

Loading required package: xtable
Loading required package: RColorBrewer
Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: IndependenceTests
$statistic
[1] NA

$p.value
[1] NA

Warning message:
In sqrt(1/(n1 - 3) + 1/(n2 - 3)) : NaNs produced

TRSbook documentation built on May 2, 2019, 2:45 a.m.