rmatReg: Regression

Description Usage Arguments Value Author(s) Examples

Description

Regression

Usage

1
rmatReg(r_mat, y_col, x_col)

Arguments

r_mat

A correlation matrix.

y_col

The column representing the criterion variable.

x_col

A vector of columns representing predictor variables.

Value

Regression beta weights and R2.

Author(s)

Allen Goebl and Jeff Jones

Examples

1
2
3
4
5
6
7
8
9
Rs <- matrix(c(1.0, 0.2,  0.3, 0.4, -0.4,
              0.2, 1.0,  0.5, 0.1,  0.1,
              0.3, 0.5,  1.0, 0.2, -0.3,
              0.4, 0.1,  0.2, 1.0,  0.4,
             -0.4, 0.1, -0.3, 0.4,  1.0), 5, 5)
ys <- 5
xs <- 1:4

rmatReg(Rs, ys, xs)

Example output

$R2
          [,1]
[1,] 0.6986045

$beta
           [,1]
[1,] -0.6226815
[2,]  0.3748454
[3,] -0.4405582
[4,]  0.6996997

iopsych documentation built on May 2, 2019, 2:27 p.m.