ccrs {ccrs} | R Documentation |
Correcting and Clustering response style biased data
Description
Applies CCRS to ccrsdata.list
.
Usage
ccrs(ccrsdata.list,K=K,lam=lam, tandem.initial=FALSE,
tol = 1e-5, maxit = 50, trace = 1, nstart = 3, parallel=F,verbose=T)
Arguments
ccrsdata.list |
A list generated by |
K |
An integer indicating the number of content-based clusters used for CCRS estimation. |
lam |
A numeric value indicating |
tandem.initial |
A logical value indicating whether the 1st initial value is generated by CCRS tandem initialization. See Section 3.3 in the paper for the detail. |
tol |
A numeric value indicating the absolute convergence tolerance |
maxit |
An integer indicating the maximum number of iterations |
trace |
An non-negative integer. If positive, tracing information on the progress of the optimization is produced. Higher values produce more tracing information. |
nstart |
An integer indicating the number of random initial values. |
parallel |
A logical value indicating parallelization over starts is used. |
verbose |
A logical value indicaitng if the progress is printed during the iteration (only when |
Value
Returns a list with the following elements.
G |
A K by m matrix of content-based cluster centroid. |
cls.cont.vec |
A vector of integers (from 1:K) indicating the content-based cluster to which each respondent is allocated. |
opt.obval |
An optimal value of objective function. |
crs.list |
A list of class |
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
ccrsdata.list <- create.ccrsdata(X,q=q)
###CCRS
lam <- 0.8 ; K <- 2
ccrs.list <- ccrs(ccrsdata.list,K=K,lam=lam)
###check content-based clustering result
ccrs.list$cls.cont.vec
###check correction result
plot(ccrs.list$crs.list)