opscale: Optimal scaling of a data vector

Description Usage Arguments Details Value References See Also Examples

Description

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.

Usage

1
2
3
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.

Value

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 Nonmetric Hypothesis.” 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  ###   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)

Example output

Loading required package: lattice
Optimal Scaling Object for Variable x1 : 

   qual quant       os
1     1     3 1.354438
2     1     2 1.354438
3     1     2 1.354438
4     1     2 1.354438
5     2     1 1.354438
6     2     2 1.354438
7     2     3 1.354438
8     3     4 3.086489
9     3     5 3.086489
10    3     2 3.086489
11    3     6 3.086489
12    3     6 3.086489
13    3     4 3.086489
Optimal Transformation for Variable x1 : 

      Measurement Level:  Ordinal 
    Measurement Process:  Discrete 

  initial.values OS.values
1              1  1.354438
2              2  1.354438
3              3  3.086489

optiscale documentation built on Feb. 3, 2021, 9:06 a.m.