ix.mat2df {MLDS} | R Documentation |
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
.
ix.mat2df(d)
d |
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 each trial, 3 or 4 per row, with the signs + - - +. The column corresponding to the lowest level stimulus is deleted, as its coefficient is contrained to equal 0 in the current parameterization of the problem. Thus, 3 non-zero terms would be of the form - - +, indicating the presence of the lowest level stimulus in the trial. |
A 5 column data.frame which could be coerced to interger.
resp |
The response, 0 or 1, indicating which pair was chosen |
S1-S4 |
The rank of the 4 stimulus levels presented on each trial. |
Kenneth Knoblauch
data(AutumnLab) ix.mat <- make.ix.mat(AutumnLab) #orig.df <- ix.mat2df(ix.mat) # should be the same as original # better to use as.mlds.df as ix.mat2df is deprecated orig.df <- as.mlds.df(ix.mat)