Learn R Programming

iopsych (version 0.90.1)

rmatReg: Regression

Description

Regression

Usage

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab