Description Usage Arguments Value References See Also Examples
View source: R/generate.rsdata.R
Simulates artificial preference data containing content-based (and response-style-based) clusters.
1 2 |
n |
An integer indicating the number of respondents. |
m |
An integer indicating the number of items. |
q |
An integer indicating the maximum rating. |
K.true |
An integer indicating the true number of content-based clusters for n respondents. |
H.true |
An integer indicating the true number of response-style-based clusters for n respondents. This is needed when |
clustered.rs |
A logical value indicating whether response-style-based cluster structure exists in generated data. If |
cls.cont.vec |
A vector of integers (from 1:K.true) of length n indicating the content-based cluster to which each respondent is allocated in artificial data. If it's |
cls.rs.vec |
A vector of integers (from 1:H.true) of length n indicating the response-style-based clusters. If it's |
savedata |
A logical value indicating whether artificial data are saved as csv files. The default is |
A list with the following elements:
|
An n by m matrix of categorical variables. |
|
An n by m matrix of true preference data |
|
An n by m matrix of categorical variables transformed by reference boundaries. |
|
A vector of integers (from 1:H.true) indicating content-based clusters used to generate artificial data. |
|
A vector of integers (from 1:H.true) indicating response-style-based clusters used to generate artificial data. |
Takagishi, M., Velden, M. van de & Yadohisa, H. (2019). Clustering preference data in the presence of response style bias, to appear in British Journal of Mathematical and Statistical Psychology.
1 2 3 4 5 | #data setting
n <- 30 ; m <- 10 ; H.true <- 2 ; K.true <- 2 ; q <- 5
datagene <- generate.rsdata(n=n,m=m,K.true=K.true,H.true=H.true,q=q,clustered.rs = TRUE)
#obtain n x m data matrix
X <- datagene$X
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.