make.ix.mat
generates a $n x p$ matrix from the $n x 5$ column data.frame storing the results of a difference scaling experiment, where $p$ is the number of stimulus levels tested and $n$ is the number of trials. The first column is the response (0 or 1), and the $p - 1$ succeeding columns code covariates for all but the first stimulus level, which is contrained to be 0. These columns take the value 0 unless the stimulus level was in the trial, in which case they take, in order, the values, 1, -1, -1, 1.make.ix.mat(data, xi = NULL, ...)
resp
and the next 4 columns the index of the stimulus level, 1 to $p$, labelled S1-S4
data
.resp
(0, 1) is coded in the first column. This could be logical, instead.mlds
and method
= dQuote{glm}, each stimulus level is treated as a covariate taking on the values 0, if it was not present in the trial, or -1 or 1, the latter two depending on the ordinal stimulus level within the trial. This is a helper function to transform the typical 5 column data.frame from a difference scaling experiment, indicating the response and the 4 stimulus levels, to one in the format described above. Matrices of this form can also be used as newdata
for the predict method. This is exploited in the function like6pt
. It is here that the argument xi
is necessary since the data.frame for the first of the 6-point comparisons does not contain the highest level of the scale and so needs to be specified so that the data.frame conforms with that used to generate the ix.mat2df
, mlds
, lik6pt
, glm
data(AutumnLab)
make.ix.mat(AutumnLab)
mlds(AutumnLab, c(1, seq(6, 30, 3)))
Run the code above in your browser using DataLab