Learn R Programming

MLDS (version 0.1-5)

ix.mat2df: Transform data.frame back to Raw Difference Scale Format

Description

ix.mat2df converts a long data.frame that is used as the data argument for mlds with method = glm to the 5 column format, typically from the results of a difference scaling experiment. The first column is the response and the next four are the ranks of the stimulus levels used in each trial, the 2 pairs. ix.mat2df is the inverse of make.ix.mat. This form of data.frame is used with the optim method of mlds.

Usage

ix.mat2df(x)

Arguments

x
a data.frame with $p$ columns and $n$ rows, where $p$ is the number of stimulus levels and $n$ is the number of trials. The first column is the resp, 0 or 1, and the next $p - 1$ columns correspond to the incidences of the stimulus levels on

Value

  • A 5 column data.frame which could be coerced to interger.
  • respThe response, 0 or 1, indicating which pair was chosen
  • S1-S4The rank of the 4 stimulus levels presented on each trial.

See Also

make.ix.mat, mlds

Examples

Run this code
data(AutumnLab)
ix.mat <- make.ix.mat(AutumnLab)
orig.df <- ix.mat2df(ix.mat) # should be the same as original

Run the code above in your browser using DataLab