Description Usage Arguments Details Value Author(s) References See Also Examples

This function performs optimal scaling by maximizing a certain aspect of the correlation matrix.

1 |

`data` |
Data frame or matrix |

`aspect` |
Function on the correlation matrix (see details) |

`level` |
Vector with scale level of the variables ("nominal" or "ordinal"). If all variables have the same scale level, only one value can be provided |

`itmax` |
Maximum number of iterations |

`eps` |
Convergence criterion |

`...` |
Additional parameters for aspect |

We provide various pre-specified aspects:

`"aspectAbs"`

takes the sum of the absolute values of the correlations to the power `pow`

. The optional argument `pow = 1`

.

`"aspectSum"`

the sum of the correlations to the power of `pow`

. Again, as default `pow = 1`

.

`"aspectDeterminant"`

computes the determinant of the correlation matrix; no additional arguments needed.

`"aspectEigen"`

the sum of the first p eigenvalues (principal component analysis). By default the argument `p = 1`

.

`"aspectSMC"`

the squared multiple correlations (multiple regression) with respect to a target variable. By default `targvar = 1`

which implies that the first variable of the dataset is taken as response.

`"aspectSumSMC"`

uses the sum of all squared multiple correlations (path analysis).

Alternatively, the user can write his own aspect, e.g. the function `myAspect(r, ...)`

with r as the correlation matrix. This function must return a list with the function value as first list element and the first derivative with respect to r as the second. Then `aspect = myAspect`

and additional arguments go into `...`

in `maxAspect()`

.

`loss` |
Final value of the loss function |

`catscores` |
Resulting category scores (after optimal scaling) |

`cormat` |
Correlation matrix based on the scores |

`eigencor` |
Eigenvalues of the correlation matrix |

`indmat` |
Indicator matrix (dummy coded) |

`scoremat` |
Transformed data matrix (i.e with category scores resulting from optimal scaling) |

`burtmat` |
Burt matrix |

`niter` |
Number of iterations |

Jan de Leeuw, Patrick Mair

Mair, P., & de Leeuw, J. (2010). Scaling variables by optimizing correlational and non-correlational aspects in R. Journal of Statistical Software, Volume 32, Issue 9.

de Leeuw, J. (1988). Multivariate analysis with optimal scaling. In S. Das Gupta and J.K. Ghosh, Proceedings of the International Conference on Advances in Multivariate Statistical Analysis, pp. 127-160. Calcutta: Indian Statistical Institute.

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 | ```
## maximizes the first eigenvalue
data(galo)
res.eig1 <- corAspect(galo[,1:4], aspect = "aspectEigen")
res.eig1
summary(res.eig1)
## maximizes the first 2 eigenvalues
res.eig2 <- corAspect(galo[,1:4], aspect = "aspectEigen", p = 2)
res.eig2
## maximizes the absolute value of cubic correlations
res.abs3 <- corAspect(galo[,1:4], aspect = "aspectAbs", pow = 3)
res.abs3
## maximizes the sum of squared correlations
res.cor2 <- corAspect(galo[,1:4], aspect = "aspectSum", pow = 2)
res.cor2
## maximizes the determinant
res.det <- corAspect(galo[,1:4], aspect = "aspectDeterminant")
res.det
## maximizes SMC, IQ as target variable
res.smc <- corAspect(galo[,1:4], aspect = "aspectSMC", targvar = 2)
res.smc
## maximizes the sum of SMC
res.sumsmc <- corAspect(galo[,1:4], aspect = "aspectSumSMC")
res.sumsmc
## some user-defined non-sense aspect
## first list element corresponds to function value, second to first derivative
myAspect <- function(r, a = 1, b = 1) list(a*b*r, matrix(a*b, nrow = nrow(r), ncol = ncol(r)))
res.my <- corAspect(galo[,1:4], aspect = myAspect, a = 2, b = 4)
res.my
``` |

aspect documentation built on May 26, 2018, 3 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.