Library: | metrics |
See also: | glm dpls makedesign |
Macro: | redun | |
Description: | calculating single redundance and redundance vector for dpls macro as measure for goodness |
Usage: | {red,redm}=redun(b,sk,lk,skl,y) | |
Input: | ||
b | a matrix with loadings | |
sk | a matrix with path coefficients | |
lk | a matrix with latent variables | |
skl | a matrix with lagged path coefficients | |
y | a matrix with manifest variables (indicators) | |
Output: | ||
red | a scalar with single redundance value | |
redm | a vector with redundace values |
library("metrics") randomize(13409) b1=0.3 c1=0.6 s=500 n1=normal(s+1) n1lag=n1[1:s,] n1=n1[2:rows(n1),] n2=b1*n1+c1*n1lag+normal(rows(n1))/5 n=n1 ~ n2 nn=n./sqrt(var(n)) p=( 1 | 2 | 3 | 4 | 0 | 0 | 0) ~ (0 | 0 | 0| 0 | 5 | 6 | 7) y=nn*p'+normal(rows(n),rows(p))/8 d=(0 | 1) ~ (0 | 0) dl=(0 | 1) ~ (0 | 0) w=(1 | 1 | 1 | 1 | 0 | 0 | 0) ~ (0 | 0 | 0 | 0 | 1 | 1 | 1 ) {wg,b,sk,skl,lk,iter}=dpls(w,d,w,dl,y,3) {red,redm}=redun(b,sk,lk,skl,y) sk skl b red
Contents of sk [1,] 0 0 [2,] 0.423 0 Contents of skl [1,] 0 0 [2,] 0.856 0 Contents of b [1,] 0.9967 0 [2,] 2.0131 0 [3,] 3.005 0 [4,] 4.0134 0 [5,] 0 5.0093 [6,] 0 5.9997 [7,] 0 6.9937 Contents of red [1,] 0.90498
Library: | metrics |
See also: | glm dpls makedesign |