shepard | R Documentation |
Graph showing data (assumed quantitative) on vertical axis, optimally-scaled data on horizontal axis.
shepard(x, ...)
shep.plot(x.quant, os.data, main.title = "Shepard Diagram")
x |
An object of class |
x.quant |
Data vector, assumed to be quantitative. |
os.data |
Optimally-scaled data. |
main.title |
Main title for graph. |
... |
Ignored |
shepard()
and shep.plot()
both
produce an object of class trellis
If using shep.plot()
,
the Shepard diagram should be created using "raw" optimally scaled values.
That is, the OS values should NOT be rescaled to the mean and standard
deviation of the original qualitative data.
### 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, optimally scaled
### values are not rescaled
op.scaled <- opscale(x.qual=x1, x.quant=x2,
level=2, process=1,
rescale=FALSE)
### Create Shepard diagram
shepard(op.scaled)
### Same results are produced by:
shep.plot(op.scaled$quant, op.scaled$os)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.