Skip to content

Commit

Permalink
add vignetter for rpluce
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiAtsusaka committed Nov 28, 2024
1 parent 0ff65a2 commit 2e1acb5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions vignettes/v6-simulate-data.Rmd
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)
```

0 comments on commit 2e1acb5

Please sign in to comment.