Learn R Programming

SciencesPo (version 0.11.21)

rstack: Produces a Stacked Table With Correlations

Description

Pearson's product-moment coefficient is the well known degree to which two or more variables are linearly associated. In a two-dimensional table, the degree of correlation among the variables is quantified by the correlation coefficient.

Usage

rstack(m)

Arguments

m
is a square matrix.

Value

  • An table or a data.frame containing the correlations for m.

encoding

UTF-8

Details

The function generates a flatten table of correlations. Using it beside r2tex will produce a latex-like correlation table. If necessary, typing cor(t(x)) will coerce x to a properly square matrix format.

References

Agresti, A., and Finlay, B. (1997) Statistical methods for the social sciences.

Aldrich, John (1995) Correlations Genuine and Spurious in Pearson and Yule. Statistical Science, 10(4), 364--376.

Spiegel, M. R. (1992) Correlation Theory. in: Theory and Problems of Probability and Statistics, 2nd ed. New York: McGraw-Hill, pp. 294--323.

See Also

r2tex,rprob.

Examples

Run this code
data(nerlove63)

(table <- rprob(nerlove63) )

rstack(table)

r2tex(rstack(table))

Run the code above in your browser using DataLab