rStats.js v1.3.0
    Preparing search index...

    Function partialR

    • Partial correlation of columns i and j of x given all its other columns. Equivalent to psych::partial.r(x, c(i, j), others) in R. Returns its off-diagonal element (no missing values).

      Parameters

      • x: readonly (readonly number[])[]

        An n × p matrix (array of rows), the variables in the columns.

      • i: number

        0-based column index.

      • j: number

        0-based column index, different from i.

      Returns number

      partialR([[1, 2, 3], [2, 1, 5], [3, 5, 4], [4, 3, 8], [5, 6, 7]], 0, 1); // 0.9804877404385672