plot.crs: Plot 'crs' objects

Description Usage Arguments Details References See Also Examples

View source: R/plot.crs.R

Description

Plots results of correction (1st plot: estimated response functions, 2nd plot: coefficient plot. See Appendix A of the reference paper for the 2nd plot).

Usage

1
2
## S3 method for class 'crs'
plot(x, H = NULL, cls.rs.vec = NULL, ...)

Arguments

x

An object of class crs.

H

An integer indicating the number of response-style-based clusters to display the correction result. If H=NULL and cls.rs.vec=NULL, H is set as H=n. If H=NULL but cls.rs.vec!=NULL, H is set as H=max(cls.rs.vec). The default is H=NULL.

cls.rs.vec

An integer vector of length n indicating response-style-based clusters for n respondents. If cls.rs.vec=NULL and H!=NULL, clusters are determined by k-means clustering of Beta. The default is cls.rs.vec=NULL.

...

Additional arguments passed to plot.

Details

Correction results for each respondent are displayed. If either response-style-based clusters or the number of response-style-based clusters are specified, the correction results of response-style-based clusters are displayed.

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

ccrs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
###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)
crs.list <- correct.rs(ccrsdata.list)
###You can check correction result using this \code{crs.plot} function.
plot(crs.list)

#####You can also check correction result obtained
#####by a simultaneous analysis of correction and content-based clustering.
###CCRS
lam <- 0.8 ; K <- 2
ccrs.list <- ccrs(ccrsdata.list,K=K,lam=lam)
###check correction result using this \code{crs.plot} function.
plot(ccrs.list$crs.list)

Example output

K= 2 , lam= 0.8 
Start     1 Iter     1 Loss 8.98721966 Diff 0.000000000000 
Start     1 Iter     1 Loss 4.21912980 Diff -4.768089853940 
Start     1 Iter     1 Loss 3.92712269 Diff -0.292007110260 
Start     1 Iter     2 Loss 3.77153046 Diff -0.155592231155 
Start     1 Iter     2 Loss 3.13286197 Diff -0.638668497716 
Start     1 Iter     2 Loss 3.03035306 Diff -0.102508904051 
Start     1 Iter     3 Loss 2.97333562 Diff -0.057017439337 
Start     1 Iter     3 Loss 2.77514065 Diff -0.198194976345 
Start     1 Iter     3 Loss 2.77514065 Diff 0.000000000000 
  converged at 2 th iteration.
Start     2 Iter     1 Loss 8.93830406 Diff 0.000000000000 
Start     2 Iter     1 Loss 4.19692416 Diff -4.741379900535 
Start     2 Iter     1 Loss 3.91828848 Diff -0.278635683181 
Start     2 Iter     2 Loss 3.77451674 Diff -0.143771732998 
Start     2 Iter     2 Loss 2.93313907 Diff -0.841377673806 
Start     2 Iter     2 Loss 2.86339328 Diff -0.069745792765 
Start     2 Iter     3 Loss 2.79412660 Diff -0.069266677653 
Start     2 Iter     3 Loss 2.76578204 Diff -0.028344562892 
Start     2 Iter     3 Loss 2.76578204 Diff 0.000000000000 
  converged at 2 th iteration.
Start     3 Iter     1 Loss 10.09285325 Diff 0.000000000000 
Start     3 Iter     1 Loss 4.14648522 Diff -5.946368023276 
Start     3 Iter     1 Loss 3.89597048 Diff -0.250514745800 
Start     3 Iter     2 Loss 3.74274028 Diff -0.153230193779 
Start     3 Iter     2 Loss 3.14426347 Diff -0.598476813401 
Start     3 Iter     2 Loss 3.02737923 Diff -0.116884239918 
Start     3 Iter     3 Loss 2.97306237 Diff -0.054316862391 
Start     3 Iter     3 Loss 2.77463364 Diff -0.198428729880 
Start     3 Iter     3 Loss 2.77463364 Diff 0.000000000000 
  converged at 2 th iteration.
Warning message:
`as_data_frame()` is deprecated as of tibble 2.0.0.
Please use `as_tibble()` instead.
The signature and semantics have changed, see `?as_tibble`.
This warning is displayed once every 8 hours.
Call `lifecycle::last_warnings()` to see where this warning was generated. 

ccrs documentation built on May 1, 2019, 10:11 p.m.