-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ff65a2
commit 2e1acb5
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: "6. Simulating Ranking Data" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{6. Simulating Ranking Data} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
``` | ||
|
||
In this vignette, we describe our helper function `rpluce` to simulate ranking data based on the Plackett-Luce model, also known as the rank-order logit or random utility model. To draw from the PL, `rpluce` requires a vector of probabilities that `t` items will be selected as the first choice, respectively. For each unit, the output provides a full ordering of `t` items with distinct alphabet letters. | ||
|
||
```{r} | ||
draw <- rpluce(n = 50, | ||
t = 4, | ||
prob = c(0.4, 0.2, 0.2, 0.2)) | ||
head(draw) | ||
``` |