opscale function

Optimal scaling of a data vector

Optimal scaling of a data vector

This function produces an object of class "opscale", containing a vector that is a least-squares approximation to a vector of quantitative values, subject to measurement constraints based upon a vector of qualitative data values.

opscale(x.qual, x.quant = seq(1:length(x.qual)), level = 1, process = 1, na.impute = FALSE, na.assign = TRUE, rescale = TRUE)

Arguments

  • x.qual: A vector of data values, assumed to be qualitative.
  • x.quant: A vector of quantitative values.
  • level: Measurement level of x.qual. 1=nominal, 2=ordinal.
  • process: Measurement process of x.qual. 1=discrete, 2=continuous.
  • na.impute: If TRUE, then assign x.quant values to optimally scaled vector for missing entries in x.qual. of FALSE then assign NA to entries in optimally scaled vector corresponding to missing entries in x.qual.
  • na.assign: If TRUE, then if x.quant is missing, assign mean of optimally scaled values for the corresponding x.qual value to the optimally scaled vector. If FALSE, then leave optimally scaled value missing, even if x.qual value is present.
  • rescale: If TRUE then rescale optimally scaled vector to same mean and standard deviation as x.qual.

Details

The opscale() function operationalizes a measurement theory proposed by Young (1981) in order to facilitate an analysis strategy called Alternating Least Squares, Optimal Scaling . The optimal scaling transformation produces a vector (say, OS) that is a least-squares approximation to x.quant, subject to measurement constraints based upon x.qual. If x.qual is nominal level, then the values in OS are the conditional means of x.quant, within distinct categories of x.qual. If x.qual is ordinal level, then the values in OS are the conditional means of x.quant, adjusted to be weakly monotonic to the values in x.qual, using Kruskals (1964b) monotonic transformation. If x.qual is discrete, then all data objects sharing a common value in x.qual must be assigned the same value in OS. If x.qual is continuous, then data objects sharing a common value in x.qual can fall within a closed interval of values in OS. The continuous-discrete measurement process distinction corresponds to Kruskals (1964a) primary and secondary approaches to ties.

Returns

The opscale() function returns an object of class "opscale" containing a list with the following components: - qual: The qualitative data vector, x.qual

  • quant: The vector of quantitative values, x.quant

  • os: The vector of optimally scaled values

  • varname: The name of the qualitative data vector, x.qual

  • measlev: The measurement level of the qualitative data vector specified in the level argument to opscale

  • measproc: The measurement process of the qualitative data vector specified in the process argument to opscale

  • rescale: Value of the rescale argument to opscale

  • os.raw.mean: Mean of optimally scaled values before rescaling

  • os.raw.sd: Standard deviation of optimally scaled values before rescaling

References

Kruskal, Joseph B. (1964a) Multidimensional Scaling by Optimizing Goodness of Fit to a NonmetricHypothesis. Psychometrika 29: 1-27.

Kruskal, Joseph B. (1964b) Nonmetric Multidimensional Scaling: A Numerical Method. Psychometrika 29: 115-129.

Young, Forrest W. (1981) Quantitative Analysis of Qualitative Data. Psychometrika 46: 357-388.

See Also

plot.opscale, print.opscale, summary.opscale

Examples

### x1 is vector of qualitative data ### x2 is vector of quantitative values x1 <- c(1,1,1,1,2,2,2,3,3,3,3,3,3) x2 <- c(3,2,2,2,1,2,3,4,5,2,6,6,4) ### Optimal scaling, specifying that x1 ### is ordinal-discrete op.scaled <- opscale(x.qual=x1, x.quant=x2, level=2, process=1) print(op.scaled) summary(op.scaled)
  • Maintainer: Dave Armstrong
  • License: GPL-2
  • Last published: 2024-05-16

Useful links