# calculate ratings from sequence of rating events, allowing for more than two stimuli

### Description

calculate ratings from sequence of rating events, allowing for more than two stimuli

### Usage

1 |

### Arguments

`xdata` |
data.frame or matrix with stimulus IDs, each row representing one trial, needs to contain at least two columns |

`winner` |
numeric vector of the same length as |

`runs` |
numeric, the number of times the data set should be randomized |

`startvalue` |
numeric, initial value of ratings, by default |

`k` |
numeric, value of |

`progressbar` |
logical, by default |

`mode` |
character, either |

### Details

The `mode="avg"`

option considers the losers of the trial as one individual/stimulus, whose rating is averaged. This reflects one rating step for each trial (as for `elochoice()`

).

The `mode="seq"`

option runs a sequence of interactions *within* a trial, i.e. one rating step for each of the loosing stimuli. E.g. if you have three stimuli, that would be two rating steps. With four stimuli, we would have three steps, etc.

Because of the larger number of rating events with `mode="seq"`

, the range of Elo-ratings will be larger as compared to `mode="avg"`

. The average values will be the same for both though (start value). See examples...

Also note that this is an experimental function that has not yet been tested thoroughly! In addition, this function calculates winning probabilities in a slightly different way as compared to `elochoice`

, i.e. based on normal probabilities (see `elochoice`

).

### Value

a matrix with ratings

### Author(s)

Christof Neumann

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
## Not run:
data(physical)
y <- round(triplets(physical[,2:3], winner=rep(1,nrow(physical)), runs = 1))
x <- ratings(elochoice(physical$Winner, physical$Loser, runs = 1), show = "all", drawplot = FALSE)
x <- x[order(names(x))]
plot(x, y)
xdata <- as.matrix(t(sapply(1:500, function(x)sample(letters[1:8], 3))))
xdata <- t(apply(xdata, 1, sort))
winner <- sample(1:3, nrow(xdata), TRUE, prob = c(4,0.8, 0.1))
x <- triplets(xdata, winner, runs=20, mode="avg")
y <- triplets(xdata, winner, runs=20, mode="seq")
# note different ranges along the axes
plot(colMeans(x), colMeans(y))
range(colMeans(x))
range(colMeans(y))
## End(Not run)
``` |