rank.LN: Rank responses under the Bayesian framework according to the...

Description Usage Arguments Value Author(s) References See Also Examples

Description

Rank responses of a single response question or a multiple response question under the Bayesian framework according to the loss function in Method 1 of Wang and Huang (2004).

Usage

1
rank.LN(data,response.number,prior.parameter,c)

Arguments

data

A m x n matrix dij, where dij = 0 or 1. If the ith respondent selects the jth response, then dij = 1, otherwise dij = 0.

response.number

The number of the responses.

prior.parameter

The parameter vector of the Dirichlet prior distribution, where the vector dimension is 2^response.number.

c

The value of c in the loss function

Value

The rank.LN returns the estimated probabilities of the responses being selected in the first line and the ranks of the responses in the second line.

Author(s)

Hsiuying Wangwang@stat.nctu.edu.tw,Yu-Chun Linrestart79610@hotmail.com

References

Wang, H. and Huang, W. H. (2014). Bayesian Ranking Responses in Multiple Response Questions. Journal of the Royal Statistical Society: Series A (Statistics in Society), 177, 191-208.

See Also

rank.btmm,rank.btnr,rank.btqn,rank.L2R,rank.gs,rank.wald

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## This is an example to rank three responses in a multiple response
## question when the number of respondents is 1000 and the value e2R 
## is 0.15. In this example, we do not use a real data, but generate 
## data in the first three lines.
A <-sample.int(2,1000,replace=TRUE,prob=c(0.37,0.63))-1
B <-sample.int(2,1000,replace=TRUE,prob=c(0.71,0.29))-1
C <-sample.int(2,1000,replace=TRUE,prob=c(0.22,0.78))-1
D <-cbind(A,B,C)
data <-matrix(D,nrow=1000,ncol=3)
## or upload the true data
response.number <-3
prior.parameter <- c(5,98,63,7,42,7,7,7)
c <- 0.05
rank.LN(data,response.number,prior.parameter,c)

RankResponse documentation built on May 2, 2019, 9:15 a.m.