qpPCC {qpgraph} | R Documentation

## Estimation of Pearson correlation coefficients

### Description

Estimates Pearson correlation coefficients (PCCs) and their corresponding P-values between all pairs of variables from an input data set.

### Usage

    ## S4 method for signature 'ExpressionSet':
    qpPCC(data, long.dim.are.variables=TRUE)
    ## S4 method for signature 'data.frame':
    qpPCC(data, long.dim.are.variables=TRUE)
    ## S4 method for signature 'matrix':
    qpPCC(data, long.dim.are.variables=TRUE)

### Arguments

`data` | data set from where to estimate the Pearson correlation coefficients. It can be an ExpressionSet object, a data frame or a matrix.
`long.dim.are.variables` | logical; if TRUE it is assumed that when data are in a data frame or in a matrix, the longer dimension is the one defining the random variables (default); if FALSE, then random variables are assumed to be at the columns of the data frame or matrix.

### Details

The calculations made by this function are the same as the ones made for a single pair of variables by the function `cor.test` but for all the pairs of variables in the data set.

### Value

A list with two matrices, one with the estimates of the PCCs and the other with their P-values.

### Author(s)

R. Castelo and A. Roverato

### See Also

`qpPAC`

### Examples

    nVar <- 50 # number of variables
    maxCon <- 5 # maximum connectivity per variable
    nObs <- 30 # number of observations to simulate

    I <- qpRndGraph(n.vtx=nVar, n.bd=maxCon)
    K <- qpI2K(I)

    X <- qpSampleMvnorm(K, nObs)

    pcc.estimates <- qpPCC(X)

    # Pearson correlation coefficients of the present edges
    summary(abs(pcc.estimates$R[upper.tri(pcc.estimates$R) & I]))

    # Pearson correlation coefficients of the missing edges
    summary(abs(pcc.estimates$R[upper.tri(pcc.estimates$R) & !I]))

[Package qpgraph version 1.0.0 Index]