fungibleExtrema: Locate Extrema of Fungible Regression Weights

Description Usage Arguments Value Author(s) References Examples

View source: R/fungibleExtrema.R

Description

Locate extrema of fungible regression weights.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fungibleExtrema(
  R.X,
  rxy,
  r.yhata.yhatb,
  Nstarts = 100,
  MaxMin = "Max",
  Seed = NULL,
  maxGrad = 1e-05,
  PrintLevel = 1
)

Arguments

R.X

p x p Predictor variable correlation matrix.

rxy

p x 1 Vector of predictor-criterion correlations.

r.yhata.yhatb

Correlation between least squares (yhatb) and alternate-weight (yhata) composites.

Nstarts

Maximum number of (max) minimizations from random starting configurations.

MaxMin

Character: "Max" = maximize cos(a,b); "Min" = minimize cos(a,b).

Seed

Starting seed for the random number generator. If Seed = NULL then the program will sample a random integer in the (0, 100,000) interval. Default (Seed = NULL).

maxGrad

The optimization routine will end when the maximimum of the (absolute value of the ) function gradient falls below the value specified in maxGrad. Default (maxGrad = 1E-05).

PrintLevel

(integer). If PrintLevel = 1 then the program will print additional output during function convergence. Default (PrintLevel = 1).

Value

cos.ab

cosine between OLS and alternate weights.

a

extrema of fungible weights.

k

k weights.

z

z weights: a normalized random vector.

b

OLS 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.

gradient

Gradient of converged solution.

Author(s)

Niels Waller and Jeff Jones

References

Koopman, R. F. (1988). On the sensitivity of a composite to its weights. Psychometrika, 53(4), 547–552.

Waller, N. & Jones, J. (2009). Locating the extrema of fungible regression weights in multiple regression. Psychometrika, 74, 589–602.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## Not run:   
## Example 
## This is Koopman's Table 2 Example


R.X <- matrix(c(1.00,  .69,  .49,  .39,
                .69, 1.00,  .38,  .19,
                .49,  .38, 1.00,  .27,
                .39,  .19,  .27, 1.00),4,4)


b <- c(.39, .22, .02, .43)
rxy <- R.X %*% b

OLSRSQ <- t(b) %*% R.X %*% b

theta <- .02
r.yhata.yhatb <- sqrt( 1 - (theta)/OLSRSQ)

Converged = FALSE
SEED = 1234
MaxTries = 100 
iter = 1

while( iter <= MaxTries){
   SEED <- SEED + 1
  
   cat("\nCurrent Seed = ", SEED, "\n")
   output <- fungibleExtrema(R.X, rxy, 
                             r.yhata.yhatb, 
                             Nstarts = 5,
                             MaxMin = "Min", 
                             Seed = SEED,
                             maxGrad = 1E-05,
                             PrintLevel = 1)
  
   Converged <- output$converged
   if(Converged) break
   iter = iter + 1
}  

print( output )

## Scale to replicate Koopman
a <- output$a
a.old <- a
aRa <- t(a) %*% R.X %*% a

## Scale a such that a' R a = .68659
## vc = variance of composite
vc <- aRa
## sf = scale factor
sf <- .68659/vc
a <- as.numeric(sqrt(sf)) * a
cat("\nKoopman Scaling\n")
print(round(a,2))

## End(Not run)

fungible documentation built on Sept. 29, 2021, 1:06 a.m.