# fungible: Generate Fungible Regression Weights In fungible: Psychometric Functions from the Waller Lab

 fungible R Documentation

## Generate Fungible Regression Weights

### Description

Generate fungible weights for OLS Regression Models.

### Usage

``````fungible(R.X, rxy, r.yhata.yhatb, sets, print = TRUE)
``````

### Arguments

 `R.X` p x p Predictor correlation matrix. `rxy` p x 1 Vector of predictor-criterion correlations. `r.yhata.yhatb` Correlation between least squares (yhatb) and alternate-weight (yhata) composites. `sets` Number of returned sets of fungible weights. `print` Logical, if TRUE then print 5-point summaries of alternative weights.

### Value

 `a` Number of sets x p matrix of fungible weights. `k` Number of sets x p matrix of k weights. `b` p x 1 vector of LS weights. `u` p x 1 vector of u weights. `r.yhata.yhatb` Correlation between yhata and yhatb. `r.y.yhatb` Correlation between y and yhatb. `cov.a` Expected covariance matrix for a. `cor.a` Expected correlation matrix for a.

Niels Waller

### References

Waller, N. (2008). Fungible weights in multiple regression. Psychometrika, 73, 69–703.

### Examples

``````

## Predictor correlation matrix
R.X <- matrix(c(1.00,   .56,  .77,
.56,  1.00,  .73,
.77,   .73, 1.00), 3, 3)

## vector of predictor-criterion correlations
rxy <- c(.39, .34, .38)

## OLS standardized regression coefficients
b <- solve(R.X) %*% rxy

## Coefficient of determination (Rsq)
OLSRSQ <- t(b) %*% R.X %*% b

## theta controls the correlation between
## yhatb: predicted criterion scores using OLS coefficients
## yhata: predicted criterion scores using alternate weights
theta <- .01

## desired correlation between yhata and yhatb
r.yhata.yhatb <- sqrt( 1 - (theta)/OLSRSQ)

## number of returned sets of fungible weight vectors
Nsets <- 50

output <- fungible(R.X, rxy, r.yhata.yhatb, sets = Nsets, print = TRUE)

``````

fungible documentation built on March 31, 2023, 5:47 p.m.