library(readxl)
Q1 <- read_excel("Data/Q1.xlsx")
View(Q1)
## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):
## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/
## Resources/modules/R_de.so'' had status 1
Q1
## # A tibble: 20 x 4
##    `Attribute 1` `Attribute 2` `Attribute 3` `Attribute 4`
##            <dbl>         <dbl>         <dbl>         <dbl>
##  1             1             0             0             0
##  2             1             0             0             0
##  3             0             1             0             0
##  4             0             0             0             1
##  5             1             0             0             0
##  6             0             1             0             0
##  7             1             0             0             0
##  8             0             0             0             1
##  9             0             1             1             0
## 10             1             1             0             0
## 11             1             0             0             0
## 12             0             0             0             1
## 13             1             0             1             0
## 14             0             1             0             0
## 15             0             0             1             0
## 16             0             0             0             1
## 17             0             1             0             0
## 18             0             1             0             0
## 19             0             0             1             0
## 20             1             0             0             0
library(readxl)
Q2 <- read_excel("Data/Q2.xlsx")
View(Q2)
## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):
## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/
## Resources/modules/R_de.so'' had status 1
Q2
## # A tibble: 20 x 2
##    `Attribute 1` `Attribute 2`
##            <dbl>         <dbl>
##  1             1             0
##  2             1             0
##  3             1             0
##  4             0             1
##  5             1             0
##  6             1             0
##  7             1             0
##  8             0             1
##  9             1             0
## 10             1             0
## 11             1             0
## 12             0             1
## 13             1             0
## 14             1             0
## 15             1             0
## 16             0             1
## 17             1             0
## 18             1             0
## 19             1             0
## 20             1             0
library(GDINA)
## GDINA Package [Version 2.7.8; 2020-01-15]
## More information: https://wenchao-ma.github.io/GDINA
library(readxl)
Data <- read_excel("Data/Data.xlsx")
View(Data)
## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):
## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/
## Resources/modules/R_de.so'' had status 1
Data
## # A tibble: 593 x 20
##    Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 Item10 Item11
##    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1     0     1     0     1     1     1     1     0     0      0      1
##  2     1     0     0     1     0     0     0     1     0      0      1
##  3     0     0     0     0     0     0     0     1     0      0      0
##  4     0     0     0     1     0     0     0     1     0      0      0
##  5     1     1     0     1     1     0     1     0     1      0      1
##  6     0     0     0     1     1     0     1     1     0      0      0
##  7     0     1     0     1     0     1     0     1     0      0      1
##  8     0     0     0     1     1     0     1     1     0      0      0
##  9     0     0     0     1     0     0     1     1     0      0      0
## 10     0     0     1     1     1     1     0     1     0      0      0
## # … with 583 more rows, and 9 more variables: Item12 <dbl>, Item13 <dbl>,
## #   Item14 <dbl>, Item15 <dbl>, Item16 <dbl>, Item17 <dbl>, Item18 <dbl>,
## #   Item19 <dbl>, Item20 <dbl>
mod1 <- GDINA(dat = Data, Q = Q1, model = "GDINA", verbose = 0)
mPVAF1 <- Qval(mod1,method = "PVAF",eps = -1)
mPVAF1
## 
## Q-matrix validation based on PVAF method 
## 
## Suggested Q-matrix: 
## 
##    A1 A2 A3 A4
## 1  1  0  1* 0 
## 2  1  0  0  0 
## 3  0  1  0  0 
## 4  1* 0  0  1 
## 5  1  0  0  0 
## 6  0  1  0  0 
## 7  1  0  0  0 
## 8  0  0  0  1 
## 9  0  0* 1  0 
## 10 0* 1  1* 0 
## 11 1  0  0  0 
## 12 0  0  0  1 
## 13 0* 0  1  0 
## 14 0  1  0  0 
## 15 0  0  1  0 
## 16 0  0  0  1 
## 17 0  1  0  0 
## 18 0  1  0  0 
## 19 0  0  1  0 
## 20 1  0  0  0 
## Note: * denotes a modified element.
extract(mPVAF1,what = "varsigma")
##        [,1]   [,2]   [,3]  [,4]   [,5]   [,6]   [,7]   [,8]   [,9]  [,10]
## 1000 0.0259 0.0241 0.0454 0e+00 0.0826 0.0491 0.0931 0.0001 0.0037 0.0285
## 0100 0.0271 0.0205 0.0534 0e+00 0.0364 0.0747 0.0380 0.0001 0.0061 0.0430
## 0010 0.0205 0.0125 0.0264 0e+00 0.0169 0.0290 0.0109 0.0003 0.0247 0.0408
## 0001 0.0016 0.0008 0.0014 0e+00 0.0006 0.0025 0.0002 0.0086 0.0036 0.0040
## 1100 0.0326 0.0271 0.0615 0e+00 0.0826 0.0783 0.0933 0.0003 0.0070 0.0514
## 1010 0.0341 0.0277 0.0537 0e+00 0.0837 0.0584 0.0933 0.0003 0.0255 0.0517
## 1001 0.0272 0.0259 0.0473 2e-04 0.0828 0.0517 0.0931 0.0092 0.0083 0.0317
## 0110 0.0336 0.0238 0.0585 0e+00 0.0393 0.0783 0.0391 0.0003 0.0256 0.0591
## 0101 0.0281 0.0222 0.0548 1e-04 0.0371 0.0762 0.0384 0.0092 0.0101 0.0457
## 0011 0.0207 0.0138 0.0266 1e-04 0.0172 0.0294 0.0112 0.0086 0.0260 0.0416
## 1110 0.0374 0.0292 0.0644 0e+00 0.0839 0.0806 0.0935 0.0005 0.0256 0.0631
## 1101 0.0334 0.0284 0.0624 2e-04 0.0829 0.0795 0.0933 0.0093 0.0108 0.0536
## 1011 0.0344 0.0286 0.0543 2e-04 0.0839 0.0594 0.0934 0.0100 0.0267 0.0535
## 0111 0.0340 0.0248 0.0590 1e-04 0.0396 0.0789 0.0393 0.0100 0.0267 0.0612
## 1111 0.0378 0.0301 0.0647 2e-04 0.0840 0.0813 0.0935 0.0101 0.0268 0.0651
##       [,11]  [,12]  [,13]  [,14]  [,15]  [,16]  [,17]  [,18]  [,19]  [,20]
## 1000 0.0237 0.0000 0.0073 0.0341 0.0029 0.0001 0.0555 0.0752 0.0052 0.1257
## 0100 0.0185 0.0001 0.0108 0.0700 0.0034 0.0002 0.1201 0.1711 0.0070 0.0571
## 0010 0.0106 0.0007 0.0290 0.0322 0.0192 0.0012 0.0333 0.0323 0.0375 0.0162
## 0001 0.0008 0.0066 0.0029 0.0003 0.0001 0.0301 0.0025 0.0005 0.0006 0.0000
## 1100 0.0258 0.0002 0.0127 0.0704 0.0041 0.0005 0.1207 0.1711 0.0087 0.1259
## 1010 0.0263 0.0008 0.0305 0.0490 0.0194 0.0013 0.0664 0.0827 0.0375 0.1258
## 1001 0.0245 0.0079 0.0113 0.0349 0.0031 0.0301 0.0585 0.0769 0.0060 0.1259
## 0110 0.0211 0.0007 0.0311 0.0755 0.0194 0.0012 0.1215 0.1711 0.0375 0.0582
## 0101 0.0191 0.0078 0.0143 0.0701 0.0036 0.0301 0.1211 0.1713 0.0076 0.0575
## 0011 0.0109 0.0076 0.0296 0.0327 0.0197 0.0301 0.0337 0.0330 0.0380 0.0168
## 1110 0.0273 0.0008 0.0312 0.0755 0.0195 0.0013 0.1218 0.1711 0.0375 0.1259
## 1101 0.0266 0.0079 0.0158 0.0705 0.0042 0.0301 0.1216 0.1713 0.0092 0.1260
## 1011 0.0271 0.0079 0.0311 0.0493 0.0199 0.0301 0.0674 0.0836 0.0380 0.1260
## 0111 0.0217 0.0079 0.0316 0.0759 0.0199 0.0301 0.1221 0.1713 0.0380 0.0589
## 1111 0.0282 0.0079 0.0317 0.0759 0.0200 0.0301 0.1223 0.1713 0.0380 0.1261
mod2 <- GDINA(dat = Data, Q = Q2, model = "GDINA", verbose = 0)
mPVAF2 <- Qval(mod2,method = "PVAF",eps = -1)
mPVAF2
## 
## Q-matrix validation based on PVAF method 
## 
## Suggested Q-matrix: 
## 
##    A1 A2
## 1  1  0 
## 2  1  0 
## 3  1  0 
## 4  1* 1 
## 5  1  0 
## 6  1  0 
## 7  1  0 
## 8  0  1 
## 9  1  0 
## 10 1  0 
## 11 1  0 
## 12 0  1 
## 13 1  0 
## 14 1  0 
## 15 1  0 
## 16 0  1 
## 17 1  0 
## 18 1  0 
## 19 1  0 
## 20 1  0 
## Note: * denotes a modified element.
extract(mPVAF2,what = "varsigma")
##      [,1]   [,2]   [,3]  [,4]   [,5]   [,6]   [,7]   [,8]   [,9]  [,10]
## 10 0.0384 0.0320 0.0697 0e+00 0.0489 0.0858 0.0459 0.0003 0.0083 0.0536
## 01 0.0023 0.0013 0.0013 0e+00 0.0003 0.0033 0.0002 0.0073 0.0029 0.0035
## 11 0.0392 0.0331 0.0701 1e-04 0.0491 0.0867 0.0460 0.0080 0.0108 0.0555
##     [,11]  [,12]  [,13]  [,14]  [,15]  [,16]  [,17]  [,18]  [,19]  [,20]
## 10 0.0270 0.0002 0.0164 0.0717 0.0053 0.0004 0.0920 0.1232 0.0095 0.0643
## 01 0.0005 0.0056 0.0029 0.0003 0.0001 0.0352 0.0033 0.0008 0.0004 0.0000
## 11 0.0277 0.0066 0.0189 0.0719 0.0053 0.0352 0.0931 0.1237 0.0097 0.0649