generate.rsdata {ccrs} | R Documentation |
Simulate preference data to apply CCRS
Description
Simulates artificial preference data containing content-based (and response-style-based) clusters.
Usage
generate.rsdata(n=n,m=m,q=q,K.true=K.true,H.true=NULL,clustered.rs=FALSE,
cls.cont.vec=NULL,cls.rs.vec=NULL,savedata=FALSE)
Arguments
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 |
Value
A list with the following elements:
X |
An n by m matrix of categorical variables. |
X.star |
An n by m matrix of true preference data |
X.nors |
An n by m matrix of categorical variables transformed by reference boundaries. |
cls.cont.vec |
A vector of integers (from 1:H.true) indicating content-based clusters used to generate artificial data. |
cls.rs.vec |
A vector of integers (from 1:H.true) indicating response-style-based clusters used to generate artificial data. |
References
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.
See Also
Examples
#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