SwapOrder function

Order Stimuli and Adjust Responses from Difference Scaling data.frame

Order Stimuli and Adjust Responses from Difference Scaling data.frame

Invert the order of the stimuli on each trial so that they are in physical order and not the presentation order and adjust responses, accordingly to reflect whether the lower or higher stimulus pair was selected or the inverse.

SwapOrder(data)

Arguments

  • data: data.frame or mlds.df object with five columns, resp, S1, S2, S3 and S4. resp is the binary response of the observer (it could be a logical). The other four indicate the four stimulus levels presented on a given trial. In principle, this function can be applied when the order reflects the position of the pairs and not their physical ordering.

Details

Pairs of stimuli in a difference scaling experiment are often presented on top and bottom and the responses, 0 and 1, refer to bottom and top pair, respectively. SwapOrder modifies the data.frame so that the stimuli are ordered by physical level and the responses, 0 and 1, are modified to refer to the lower and upper pair on the physical scale, respectively. If the object inherits also from class mlds.df , it has an invord attribute that is a logical vector of length the number of rows in the data.frame. It indicates the trials on which the higher stimulus levels were presented on the bottom. If this attribute is present, it is used to modify the data.frame. In this case, the function acts as its own inverse.

Returns

A data.frame of the same format as the input data.frame but with the stimulus order modified and the response inverted on those trials on which the higher physical level stimulus were on the bottom. If the order reflects the position, it is modified to reflect the stimulus level and vice versa.

Author(s)

Kenneth Knoblauch

Note

Storing the physical position of the stimuli allows the original configuration not to be lost when re-ordering the stimuli to reflect physical stimulus level. The invord attribute could, in principle, be used, also, to test for an influence of or bias related to the physical position.

Examples

data(kk1) kk1.swo <- SwapOrder(kk1)
  • Maintainer: Kenneth Knoblauch
  • License: GPL (>= 2)
  • Last published: 2023-08-20

Useful links