Skip to contents

GRM data simulation

Item parameters for graded response model

item_pars <- genIRTpar(nitem = 10, ncat = 3, nfac = 1)

Individual true latent traits

true_theta <- genTheta(nsample = 500, nfac = 1)

GRM data

grm_dt <- genData(eta = true_theta, ipar = item_pars)

GRM data simulation

Generate lavaan syntax

lav_syn <- genLavSyn(dat = grm_dt, nfac = 1)
#> 
#> F1 =~ NA*y1+l1*y1+l2*y2+l3*y3+l4*y4+l5*y5+l6*y6+l7*y7+l8*y8+l9*y9+l10*y10
#> 
#>  
#> F1~~ 1*F1
#> F1~ 0*1  
#> y1 | t11*t1;
#> y2 | t21*t1;
#> y3 | t31*t1;
#> y4 | t41*t1;
#> y5 | t51*t1;
#> y6 | t61*t1;
#> y7 | t71*t1;
#> y8 | t81*t1;
#> y9 | t91*t1;
#> y10 | t101*t1;
#> y1 | t12*t2;
#> y2 | t22*t2;
#> y3 | t32*t2;
#> y4 | t42*t2;
#> y5 | t52*t2;
#> y6 | t62*t2;
#> y7 | t72*t2;
#> y8 | t82*t2;
#> y9 | t92*t2;
#> y10 | t102*t2;

Conduct GRM with two different estimators

grm.fit <- runGRM(dat = grm_dt, lav.syntax = lav_syn, estimator = "WL")

Results

parameter estimates

extract_est(grm.fit)
#>    lhs op rhs label    est    se      z pvalue
#> 1   F1 =~  y1    l1  0.548 0.045 12.046  0.000
#> 2   F1 =~  y2    l2  0.621 0.045 13.819  0.000
#> 3   F1 =~  y3    l3  0.578 0.048 12.074  0.000
#> 4   F1 =~  y4    l4  0.614 0.045 13.747  0.000
#> 5   F1 =~  y5    l5  0.601 0.045 13.304  0.000
#> 6   F1 =~  y6    l6  0.753 0.040 18.790  0.000
#> 7   F1 =~  y7    l7  0.723 0.040 17.985  0.000
#> 8   F1 =~  y8    l8  0.595 0.045 13.141  0.000
#> 9   F1 =~  y9    l9  0.678 0.042 16.054  0.000
#> 10  F1 =~ y10   l10  0.609 0.045 13.547  0.000
#> 11  y1  |  t1   t11 -0.243 0.057 -4.285  0.000
#> 12  y2  |  t1   t21 -0.025 0.056 -0.447  0.655
#> 13  y3  |  t1   t31 -0.055 0.056 -0.983  0.326
#> 14  y4  |  t1   t41 -0.111 0.056 -1.965  0.049
#> 15  y5  |  t1   t51 -0.187 0.056 -3.304  0.001
#> 16  y6  |  t1   t61  0.005 0.056  0.089  0.929
#> 17  y7  |  t1   t71 -0.005 0.056 -0.089  0.929
#> 18  y8  |  t1   t81 -0.217 0.057 -3.839  0.000
#> 19  y9  |  t1   t91 -0.015 0.056 -0.268  0.789
#> 20 y10  |  t1  t101 -0.151 0.056 -2.680  0.007
#> 21  y1  |  t2   t12  0.264 0.057  4.641  0.000
#> 22  y2  |  t2   t22  0.197 0.057  3.483  0.000
#> 23  y3  |  t2   t32  0.151 0.056  2.680  0.007
#> 24  y4  |  t2   t42  0.187 0.056  3.304  0.001
#> 25  y5  |  t2   t52  0.253 0.057  4.463  0.000
#> 26  y6  |  t2   t62  0.121 0.056  2.144  0.032
#> 27  y7  |  t2   t72  0.141 0.056  2.501  0.012
#> 28  y8  |  t2   t82  0.156 0.056  2.769  0.006
#> 29  y9  |  t2   t92  0.166 0.056  2.947  0.003
#> 30 y10  |  t2  t102  0.131 0.056  2.323  0.020

IRT plots

ICCplot(grm.fit, 1)

ESplot(grm.fit , 1)

infoPlot(grm.fit, 1)

FSplot(grm.fit)

Launch app