Teacher Commitment Scale

Part 1 EFA Analysis

Load the dataset

library(haven)
TCS <- read_sav("Desktop/Current Work/Dr. Sun's Project/Teacher Commitment Scale/Teacher Commitment Scale.sav")

Decriptive Data Analysis

library(psych)
TCS_data <- TCS[,1:12]
summary(TCS_data) # TC3 Minimum Mean = 3.48; 
##       TC1             TC2             TC3             TC4       
##  Min.   :2.000   Min.   :3.000   Min.   :1.000   Min.   :3.000  
##  1st Qu.:4.000   1st Qu.:5.000   1st Qu.:2.000   1st Qu.:4.000  
##  Median :5.000   Median :5.000   Median :3.500   Median :5.000  
##  Mean   :4.667   Mean   :5.048   Mean   :3.476   Mean   :4.738  
##  3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000  
##  Max.   :6.000   Max.   :6.000   Max.   :6.000   Max.   :6.000  
##       TC5             TC6             TC7             TC8       
##  Min.   :2.000   Min.   :2.000   Min.   :2.000   Min.   :3.000  
##  1st Qu.:4.000   1st Qu.:3.250   1st Qu.:3.000   1st Qu.:5.000  
##  Median :4.000   Median :4.000   Median :4.000   Median :5.000  
##  Mean   :4.286   Mean   :4.333   Mean   :4.143   Mean   :5.024  
##  3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:6.000  
##  Max.   :6.000   Max.   :6.000   Max.   :6.000   Max.   :6.000  
##       TC9             TC10            TC11            TC12      
##  Min.   :3.000   Min.   :2.000   Min.   :4.000   Min.   :3.000  
##  1st Qu.:4.250   1st Qu.:4.000   1st Qu.:5.000   1st Qu.:5.000  
##  Median :5.000   Median :5.000   Median :5.000   Median :5.000  
##  Mean   :5.024   Mean   :4.786   Mean   :5.119   Mean   :5.119  
##  3rd Qu.:6.000   3rd Qu.:5.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :6.000   Max.   :6.000   Max.   :6.000   Max.   :6.000
table(TCS$Gender) # 1: male; 2:female
## 
##  1  2 
## 15 22
table(TCS$YTeach) # 1: "1-2 years"; 2: "3-5 years"; 3:"6-10 years"; 4:"11 years+"
## 
##  1  2  3  4 
## 10  1  4 27
table(TCS$HstDgreee) # 1: Bachelor; 2: Master; 3: Doctoral; 4: Other
## 
##  1  2  3  4 
## 17 23  1  1

Exploratory Factor Analysis (EFA)

library("Hmisc")
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
## Loading required package: ggplot2
## 
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
## 
##     %+%, alpha
## 
## Attaching package: 'Hmisc'
## The following object is masked from 'package:psych':
## 
##     describe
## The following objects are masked from 'package:base':
## 
##     format.pval, units
## Check the correlation matrix
cor(TCS_data, method = "pearson", use = "complete.obs")
##              TC1         TC2         TC3         TC4       TC5         TC6
## TC1   1.00000000  0.66737042  0.08004538  0.24771215 0.5383015  0.03865415
## TC2   0.66737042  1.00000000 -0.17113998  0.31789749 0.2710722  0.12609394
## TC3   0.08004538 -0.17113998  1.00000000 -0.06009972 0.1554789 -0.13295728
## TC4   0.24771215  0.31789749 -0.06009972  1.00000000 0.3854090  0.46803096
## TC5   0.53830146  0.27107224  0.15547888  0.38540897 1.0000000  0.22353289
## TC6   0.03865415  0.12609394 -0.13295728  0.46803096 0.2235329  1.00000000
## TC7   0.26978378  0.21759811 -0.22784870  0.49357783 0.6010427  0.32675219
## TC8   0.25924788  0.38846174  0.02547788  0.38427092 0.3926485 -0.03014318
## TC9   0.49217469  0.48135106  0.07804105  0.30679327 0.4309068  0.06220214
## TC10 -0.11432127 -0.05634904  0.14263249  0.15021084 0.1049378 -0.12461555
## TC11  0.38230298  0.38514481 -0.11437370  0.26924967 0.3675621 -0.19159916
## TC12  0.55355140  0.55696640  0.03284144  0.36241010 0.4114006 -0.10056617
##             TC7         TC8        TC9        TC10       TC11        TC12
## TC1   0.2697838  0.25924788 0.49217469 -0.11432127  0.3823030  0.55355140
## TC2   0.2175981  0.38846174 0.48135106 -0.05634904  0.3851448  0.55696640
## TC3  -0.2278487  0.02547788 0.07804105  0.14263249 -0.1143737  0.03284144
## TC4   0.4935778  0.38427092 0.30679327  0.15021084  0.2692497  0.36241010
## TC5   0.6010427  0.39264852 0.43090683  0.10493778  0.3675621  0.41140064
## TC6   0.3267522 -0.03014318 0.06220214 -0.12461555 -0.1915992 -0.10056617
## TC7   1.0000000  0.17218777 0.15504833 -0.13517864  0.2308352  0.24687837
## TC8   0.1721878  1.00000000 0.81275793  0.45171856  0.5736734  0.62104996
## TC9   0.1550483  0.81275793 1.00000000  0.29360561  0.4725758  0.64078565
## TC10 -0.1351786  0.45171856 0.29360561  1.00000000  0.3566939  0.37420006
## TC11  0.2308352  0.57367341 0.47257581  0.35669389  1.0000000  0.76724488
## TC12  0.2468784  0.62104996 0.64078565  0.37420006  0.7672449  1.00000000
## Now we reverse code the TC3
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:psych':
## 
##     logit
reversed_TC3 <- recode(TCS_data$TC3,"1=6;2=5;3=4;4=3;5=2;6=1") 
recoded_TCS_data <- TCS_data
recoded_TCS_data$TC3 <- reversed_TC3
## Check the correlation matrix
cor(recoded_TCS_data, method = "pearson", use = "complete.obs")
##              TC1         TC2         TC3        TC4        TC5         TC6
## TC1   1.00000000  0.66737042 -0.08004538 0.24771215  0.5383015  0.03865415
## TC2   0.66737042  1.00000000  0.17113998 0.31789749  0.2710722  0.12609394
## TC3  -0.08004538  0.17113998  1.00000000 0.06009972 -0.1554789  0.13295728
## TC4   0.24771215  0.31789749  0.06009972 1.00000000  0.3854090  0.46803096
## TC5   0.53830146  0.27107224 -0.15547888 0.38540897  1.0000000  0.22353289
## TC6   0.03865415  0.12609394  0.13295728 0.46803096  0.2235329  1.00000000
## TC7   0.26978378  0.21759811  0.22784870 0.49357783  0.6010427  0.32675219
## TC8   0.25924788  0.38846174 -0.02547788 0.38427092  0.3926485 -0.03014318
## TC9   0.49217469  0.48135106 -0.07804105 0.30679327  0.4309068  0.06220214
## TC10 -0.11432127 -0.05634904 -0.14263249 0.15021084  0.1049378 -0.12461555
## TC11  0.38230298  0.38514481  0.11437370 0.26924967  0.3675621 -0.19159916
## TC12  0.55355140  0.55696640 -0.03284144 0.36241010  0.4114006 -0.10056617
##             TC7         TC8         TC9        TC10       TC11        TC12
## TC1   0.2697838  0.25924788  0.49217469 -0.11432127  0.3823030  0.55355140
## TC2   0.2175981  0.38846174  0.48135106 -0.05634904  0.3851448  0.55696640
## TC3   0.2278487 -0.02547788 -0.07804105 -0.14263249  0.1143737 -0.03284144
## TC4   0.4935778  0.38427092  0.30679327  0.15021084  0.2692497  0.36241010
## TC5   0.6010427  0.39264852  0.43090683  0.10493778  0.3675621  0.41140064
## TC6   0.3267522 -0.03014318  0.06220214 -0.12461555 -0.1915992 -0.10056617
## TC7   1.0000000  0.17218777  0.15504833 -0.13517864  0.2308352  0.24687837
## TC8   0.1721878  1.00000000  0.81275793  0.45171856  0.5736734  0.62104996
## TC9   0.1550483  0.81275793  1.00000000  0.29360561  0.4725758  0.64078565
## TC10 -0.1351786  0.45171856  0.29360561  1.00000000  0.3566939  0.37420006
## TC11  0.2308352  0.57367341  0.47257581  0.35669389  1.0000000  0.76724488
## TC12  0.2468784  0.62104996  0.64078565  0.37420006  0.7672449  1.00000000
library(ltm)
## Loading required package: MASS
## Loading required package: msm
## Loading required package: polycor
## 
## Attaching package: 'polycor'
## The following object is masked from 'package:psych':
## 
##     polyserial
## 
## Attaching package: 'ltm'
## The following object is masked from 'package:psych':
## 
##     factor.scores
cronbach.alpha(recoded_TCS_data) # Report Internal Consistency (reliability)
## 
## Cronbach's alpha for the 'recoded_TCS_data' data-set
## 
## Items: 12
## Sample units: 42
## alpha: 0.758
# Principal Components Analysis
# Run a PCA to determine the number of factors
fit <- princomp(recoded_TCS_data, cor=TRUE)
summary(fit) # print variance accounted for
## Importance of components:
##                           Comp.1    Comp.2    Comp.3     Comp.4     Comp.5
## Standard deviation     2.1288240 1.4068458 1.1421142 1.07498539 0.94372257
## Proportion of Variance 0.3776576 0.1649346 0.1087021 0.09629947 0.07421769
## Cumulative Proportion  0.3776576 0.5425922 0.6512943 0.74759378 0.82181147
##                            Comp.6     Comp.7     Comp.8     Comp.9    Comp.10
## Standard deviation     0.77511270 0.67327343 0.58944641 0.51957123 0.48001132
## Proportion of Variance 0.05006664 0.03777476 0.02895392 0.02249619 0.01920091
## Cumulative Proportion  0.87187811 0.90965287 0.93860679 0.96110298 0.98030389
##                           Comp.11     Comp.12
## Standard deviation     0.37419558 0.310372390
## Proportion of Variance 0.01166853 0.008027585
## Cumulative Proportion  0.99197241 1.000000000
loadings(fit) # pc loadings
## 
## Loadings:
##      Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10
## TC1   0.318  0.115  0.474  0.270         0.143  0.233  0.116  0.427  0.267 
## TC2   0.314  0.109  0.425 -0.126  0.361  0.187         0.342 -0.440 -0.419 
## TC3          0.228  0.120 -0.822        -0.217  0.260  0.113  0.307        
## TC4   0.270  0.304 -0.369         0.156  0.419 -0.503  0.196  0.421        
## TC5   0.316  0.210         0.377 -0.377 -0.221  0.341         0.204 -0.389 
## TC6          0.505 -0.329         0.448         0.387 -0.473 -0.165        
## TC7   0.220  0.454 -0.128        -0.499 -0.141 -0.152  0.211 -0.457  0.280 
## TC8   0.365 -0.226 -0.214         0.167 -0.437 -0.257               -0.290 
## TC9   0.375 -0.152                0.316 -0.509                       0.364 
## TC10  0.150 -0.411 -0.502                0.258  0.515  0.412               
## TC11  0.345 -0.216        -0.251 -0.336  0.231        -0.565        -0.313 
## TC12  0.401 -0.187                       0.283        -0.222 -0.249  0.443 
##      Comp.11 Comp.12
## TC1   0.336   0.362 
## TC2          -0.198 
## TC3  -0.164         
## TC4          -0.148 
## TC5  -0.417  -0.166 
## TC6           0.149 
## TC7   0.318         
## TC8           0.624 
## TC9   0.125  -0.558 
## TC10  0.191         
## TC11  0.389  -0.170 
## TC12 -0.609   0.160 
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9
## SS loadings     1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
## Proportion Var  0.083  0.083  0.083  0.083  0.083  0.083  0.083  0.083  0.083
## Cumulative Var  0.083  0.167  0.250  0.333  0.417  0.500  0.583  0.667  0.750
##                Comp.10 Comp.11 Comp.12
## SS loadings      1.000   1.000   1.000
## Proportion Var   0.083   0.083   0.083
## Cumulative Var   0.833   0.917   1.000
plot(fit,type="lines") # scree plot

# From the plot we can see there are 4 primary factors contributing to the total variance
# Varimax Rotated Principal Components
scale_fa <- factanal(recoded_TCS_data,factors=4,rotation="varimax")
scale_fa # Check the factor loadings in here.
## 
## Call:
## factanal(x = recoded_TCS_data, factors = 4, rotation = "varimax")
## 
## Uniquenesses:
##   TC1   TC2   TC3   TC4   TC5   TC6   TC7   TC8   TC9  TC10  TC11  TC12 
## 0.005 0.503 0.902 0.624 0.427 0.735 0.096 0.108 0.168 0.628 0.119 0.235 
## 
## Loadings:
##      Factor1 Factor2 Factor3 Factor4
## TC1   0.992                         
## TC2   0.657   0.219   0.111         
## TC3  -0.109           0.229   0.172 
## TC4   0.196   0.276   0.510         
## TC5   0.484   0.203   0.544         
## TC6                   0.406  -0.314 
## TC7   0.177           0.929         
## TC8   0.235   0.897   0.157         
## TC9   0.483   0.764   0.101         
## TC10 -0.118   0.533  -0.115   0.247 
## TC11  0.341   0.456   0.126   0.736 
## TC12  0.523   0.510   0.130   0.462 
## 
##                Factor1 Factor2 Factor3 Factor4
## SS loadings      2.424   2.313   1.740   0.974
## Proportion Var   0.202   0.193   0.145   0.081
## Cumulative Var   0.202   0.395   0.540   0.621
## 
## Test of the hypothesis that 4 factors are sufficient.
## The chi square statistic is 32.45 on 24 degrees of freedom.
## The p-value is 0.116

According to the factor loading, we can conclude that: D1: TC1, TC2 or (TC12) D2: TC8, TC9, TC10 or (TC12) D3: TC3(weak), TC4, TC5, TC6, TC7 D4: TC11 or (TC12)

One-level CFA

# Load the R packages that needed for the analysis
library(foreign) 
library(lavaan)
## This is lavaan 0.6-7
## lavaan is BETA software! Please report any bugs.
## 
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
## 
##     cor2cov
# Establish our model
model <-'TC=~Student_Learning+Change+School+Teaching_profession
Student_Learning=~TC1+TC2+TC12
Change=~TC8+TC9+TC10
School=~TC3+TC4+TC5+TC6+TC7
Teaching_profession=~TC11'
# Factor 1 = Commitment to Student_Learning
# Factor 2 = Commitment to Change
# Factor 3 = Commitment to School
# Factor 4 = Commitment to Teaching_profession
# Fit the CFA model
# test_data <- recoded_TCS_data[,c(-3,-7)]
fit_cfa <- cfa(model, data=recoded_TCS_data)
# Check the model summary
summary(fit_cfa,fit.measure=TRUE)
## lavaan 0.6-7 ended normally after 80 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         27
##                                                       
##   Number of observations                            42
##                                                       
## Model Test User Model:
##                                                       
##   Test statistic                               100.726
##   Degrees of freedom                                51
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                               292.017
##   Degrees of freedom                                66
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.780
##   Tucker-Lewis Index (TLI)                       0.715
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -591.948
##   Loglikelihood unrestricted model (H1)             NA
##                                                       
##   Akaike (AIC)                                1237.895
##   Bayesian (BIC)                              1284.812
##   Sample-size adjusted Bayesian (BIC)         1200.261
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.152
##   90 Percent confidence interval - lower         0.108
##   90 Percent confidence interval - upper         0.196
##   P-value RMSEA <= 0.05                          0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.125
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                          Estimate  Std.Err  z-value  P(>|z|)
##   TC =~                                                     
##     Student_Lernng          1.000                           
##     Change                  1.229    0.374    3.283    0.001
##     School                  0.146    0.263    0.556    0.578
##     Teachng_prfssn          1.129    0.320    3.526    0.000
##   Student_Learning =~                                       
##     TC1                     1.000                           
##     TC2                     0.808    0.247    3.265    0.001
##     TC12                    1.369    0.327    4.191    0.000
##   Change =~                                                 
##     TC8                     1.000                           
##     TC9                     0.909    0.129    7.041    0.000
##     TC10                    0.516    0.176    2.931    0.003
##   School =~                                                 
##     TC3                     1.000                           
##     TC4                     3.772    6.636    0.568    0.570
##     TC5                     4.881    8.570    0.570    0.569
##     TC6                     3.036    5.434    0.559    0.576
##     TC7                     6.131   10.753    0.570    0.569
##   Teaching_profession =~                                    
##     TC11                    1.000                           
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .TC1               0.486    0.111    4.365    0.000
##    .TC2               0.304    0.070    4.354    0.000
##    .TC12              0.046    0.052    0.883    0.377
##    .TC8               0.106    0.072    1.467    0.142
##    .TC9               0.176    0.069    2.566    0.010
##    .TC10              0.750    0.167    4.478    0.000
##    .TC3               2.558    0.560    4.571    0.000
##    .TC4               0.503    0.136    3.694    0.000
##    .TC5               0.558    0.175    3.185    0.001
##    .TC6               1.181    0.272    4.349    0.000
##    .TC7               0.560    0.227    2.465    0.014
##    .TC11              0.000                           
##     TC                0.248    0.131    1.889    0.059
##    .Student_Lernng    0.013    0.038    0.332    0.740
##    .Change            0.305    0.106    2.872    0.004
##    .School            0.020    0.069    0.286    0.775
##    .Teachng_prfssn    0.170    0.054    3.175    0.001
# Print out the paramarter Estimates
parameterEstimates(fit_cfa)
##                    lhs op                 rhs   est     se     z pvalue
## 1                   TC =~    Student_Learning 1.000  0.000    NA     NA
## 2                   TC =~              Change 1.229  0.374 3.283  0.001
## 3                   TC =~              School 0.146  0.263 0.556  0.578
## 4                   TC =~ Teaching_profession 1.129  0.320 3.526  0.000
## 5     Student_Learning =~                 TC1 1.000  0.000    NA     NA
## 6     Student_Learning =~                 TC2 0.808  0.247 3.265  0.001
## 7     Student_Learning =~                TC12 1.369  0.327 4.191  0.000
## 8               Change =~                 TC8 1.000  0.000    NA     NA
## 9               Change =~                 TC9 0.909  0.129 7.041  0.000
## 10              Change =~                TC10 0.516  0.176 2.931  0.003
## 11              School =~                 TC3 1.000  0.000    NA     NA
## 12              School =~                 TC4 3.772  6.636 0.568  0.570
## 13              School =~                 TC5 4.881  8.570 0.570  0.569
## 14              School =~                 TC6 3.036  5.434 0.559  0.576
## 15              School =~                 TC7 6.131 10.753 0.570  0.569
## 16 Teaching_profession =~                TC11 1.000  0.000    NA     NA
## 17                 TC1 ~~                 TC1 0.486  0.111 4.365  0.000
## 18                 TC2 ~~                 TC2 0.304  0.070 4.354  0.000
## 19                TC12 ~~                TC12 0.046  0.052 0.883  0.377
## 20                 TC8 ~~                 TC8 0.106  0.072 1.467  0.142
## 21                 TC9 ~~                 TC9 0.176  0.069 2.566  0.010
## 22                TC10 ~~                TC10 0.750  0.167 4.478  0.000
## 23                 TC3 ~~                 TC3 2.558  0.560 4.571  0.000
## 24                 TC4 ~~                 TC4 0.503  0.136 3.694  0.000
## 25                 TC5 ~~                 TC5 0.558  0.175 3.185  0.001
## 26                 TC6 ~~                 TC6 1.181  0.272 4.349  0.000
## 27                 TC7 ~~                 TC7 0.560  0.227 2.465  0.014
## 28                TC11 ~~                TC11 0.000  0.000    NA     NA
## 29                  TC ~~                  TC 0.248  0.131 1.889  0.059
## 30    Student_Learning ~~    Student_Learning 0.013  0.038 0.332  0.740
## 31              Change ~~              Change 0.305  0.106 2.872  0.004
## 32              School ~~              School 0.020  0.069 0.286  0.775
## 33 Teaching_profession ~~ Teaching_profession 0.170  0.054 3.175  0.001
##    ci.lower ci.upper
## 1     1.000    1.000
## 2     0.495    1.963
## 3    -0.369    0.661
## 4     0.501    1.756
## 5     1.000    1.000
## 6     0.323    1.292
## 7     0.729    2.009
## 8     1.000    1.000
## 9     0.656    1.162
## 10    0.171    0.861
## 11    1.000    1.000
## 12   -9.234   16.778
## 13  -11.915   21.677
## 14   -7.614   13.686
## 15  -14.945   27.206
## 16    1.000    1.000
## 17    0.268    0.704
## 18    0.167    0.441
## 19   -0.056    0.148
## 20   -0.036    0.247
## 21    0.042    0.310
## 22    0.421    1.078
## 23    1.461    3.654
## 24    0.236    0.769
## 25    0.215    0.902
## 26    0.649    1.714
## 27    0.115    1.004
## 28    0.000    0.000
## 29   -0.009    0.505
## 30   -0.061    0.086
## 31    0.097    0.514
## 32   -0.116    0.156
## 33    0.065    0.276
modificationindices(fit_cfa)
##                     lhs op                 rhs     mi    epc sepc.lv sepc.all
## 34                   TC =~                 TC1  1.621 -5.175  -2.575   -2.981
## 35                   TC =~                 TC2  0.820 -2.964  -1.475   -2.142
## 36                   TC =~                TC12 11.343 28.938  14.400   19.715
## 37                   TC =~                 TC8  3.124 -1.117  -0.556   -0.627
## 38                   TC =~                 TC9  2.139  0.803   0.400    0.466
## 39                   TC =~                TC10  0.121  0.167   0.083    0.086
## 40                   TC =~                 TC3  0.097 -0.191  -0.095   -0.059
## 41                   TC =~                 TC4  1.210  0.342   0.170    0.183
## 42                   TC =~                 TC5  3.540  0.678   0.337    0.314
## 43                   TC =~                 TC6  5.427 -1.001  -0.498   -0.419
## 44                   TC =~                 TC7  2.287 -0.641  -0.319   -0.260
## 46     Student_Learning =~                 TC8  4.696 -1.229  -0.627   -0.708
## 47     Student_Learning =~                 TC9  3.446  0.919   0.468    0.546
## 48     Student_Learning =~                TC10  0.094  0.134   0.068    0.071
## 49     Student_Learning =~                 TC3  0.146 -0.223  -0.114   -0.071
## 50     Student_Learning =~                 TC4  1.193  0.323   0.165    0.178
## 51     Student_Learning =~                 TC5  3.309  0.624   0.318    0.296
## 52     Student_Learning =~                 TC6  5.090 -0.923  -0.471   -0.396
## 53     Student_Learning =~                 TC7  2.183 -0.596  -0.304   -0.248
## 54     Student_Learning =~                TC11  0.236  4.091   2.086    2.993
## 55               Change =~                 TC1  0.704 -0.199  -0.164   -0.190
## 56               Change =~                 TC2  0.029  0.032   0.026    0.038
## 57               Change =~                TC12  0.071  0.060   0.049    0.067
## 58               Change =~                 TC3  0.357 -0.204  -0.168   -0.105
## 59               Change =~                 TC4  2.039  0.241   0.199    0.214
## 60               Change =~                 TC5  3.898  0.378   0.311    0.290
## 61               Change =~                 TC6  1.865 -0.325  -0.268   -0.226
## 62               Change =~                 TC7  3.696 -0.418  -0.344   -0.281
## 63               Change =~                TC11  0.001 -0.009  -0.008   -0.011
## 64               School =~                 TC1  2.255  1.374   0.218    0.252
## 65               School =~                 TC2  0.467  0.496   0.079    0.114
## 66               School =~                TC12  1.086 -0.603  -0.096   -0.131
## 67               School =~                 TC8  0.072  0.165   0.026    0.029
## 68               School =~                 TC9  0.235  0.300   0.048    0.055
## 69               School =~                TC10  1.357 -1.213  -0.192   -0.199
## 70               School =~                TC11  0.127 -0.222  -0.035   -0.051
## 71  Teaching_profession =~                 TC1  1.790 -0.418  -0.292   -0.337
## 72  Teaching_profession =~                 TC2  1.997 -0.353  -0.246   -0.357
## 73  Teaching_profession =~                TC12  6.264  0.890   0.620    0.849
## 74  Teaching_profession =~                 TC8  0.784  0.177   0.123    0.139
## 75  Teaching_profession =~                 TC9  1.669 -0.240  -0.167   -0.195
## 76  Teaching_profession =~                TC10  0.774  0.220   0.153    0.159
## 77  Teaching_profession =~                 TC3  0.329  0.223   0.156    0.097
## 78  Teaching_profession =~                 TC4  0.218  0.090   0.063    0.068
## 79  Teaching_profession =~                 TC5  2.112  0.321   0.223    0.208
## 80  Teaching_profession =~                 TC6  7.113 -0.726  -0.506   -0.426
## 81  Teaching_profession =~                 TC7  0.540 -0.185  -0.129   -0.105
## 82                  TC1 ~~                 TC2 11.343  0.214   0.214    0.556
## 83                  TC1 ~~                TC12  0.820 -0.063  -0.063   -0.421
## 84                  TC1 ~~                 TC8  5.804 -0.129  -0.129   -0.568
## 85                  TC1 ~~                 TC9  8.559  0.158   0.158    0.541
## 86                  TC1 ~~                TC10  7.232 -0.258  -0.258   -0.427
## 87                  TC1 ~~                 TC3  0.561 -0.131  -0.131   -0.118
## 88                  TC1 ~~                 TC4  0.602 -0.065  -0.065   -0.132
## 89                  TC1 ~~                 TC5  5.297  0.213   0.213    0.409
## 90                  TC1 ~~                 TC6  0.059  0.030   0.030    0.039
## 91                  TC1 ~~                 TC7  0.003 -0.005  -0.005   -0.010
## 92                  TC1 ~~                TC11  1.693 -0.073  -0.073       NA
## 93                  TC2 ~~                TC12  1.621 -0.072  -0.072   -0.606
## 94                  TC2 ~~                 TC8  0.164 -0.017  -0.017   -0.096
## 95                  TC2 ~~                 TC9  2.062  0.061   0.061    0.266
## 96                  TC2 ~~                TC10  6.149 -0.188  -0.188   -0.394
## 97                  TC2 ~~                 TC3  1.931  0.193   0.193    0.219
## 98                  TC2 ~~                 TC4  0.330  0.038   0.038    0.098
## 99                  TC2 ~~                 TC5  0.338 -0.043  -0.043   -0.104
## 100                 TC2 ~~                 TC6  1.792  0.129   0.129    0.215
## 101                 TC2 ~~                 TC7  0.002  0.004   0.004    0.009
## 102                 TC2 ~~                TC11  1.999 -0.064  -0.064       NA
## 103                TC12 ~~                 TC8  0.548 -0.026  -0.026   -0.372
## 104                TC12 ~~                 TC9  0.020  0.005   0.005    0.053
## 105                TC12 ~~                TC10  4.041  0.106   0.106    0.572
## 106                TC12 ~~                 TC3  1.176 -0.104  -0.104   -0.304
## 107                TC12 ~~                 TC4  0.239  0.023   0.023    0.150
## 108                TC12 ~~                 TC5  0.206 -0.023  -0.023   -0.147
## 109                TC12 ~~                 TC6  0.991 -0.067  -0.067   -0.286
## 110                TC12 ~~                 TC7  0.101 -0.018  -0.018   -0.114
## 111                TC12 ~~                TC11  5.683  0.147   0.147       NA
## 112                 TC8 ~~                 TC9  0.121  0.073   0.073    0.536
## 113                 TC8 ~~                TC10  2.139  0.113   0.113    0.402
## 114                 TC8 ~~                 TC3  0.144  0.045   0.045    0.087
## 115                 TC8 ~~                 TC4  1.478  0.069   0.069    0.300
## 116                 TC8 ~~                 TC5  0.065 -0.016  -0.016   -0.066
## 117                 TC8 ~~                 TC6  0.353 -0.049  -0.049   -0.138
## 118                 TC8 ~~                 TC7  0.000  0.000   0.000    0.002
## 119                 TC8 ~~                TC11  2.826  0.063   0.063       NA
## 120                 TC9 ~~                TC10  3.124 -0.130  -0.130   -0.358
## 121                 TC9 ~~                 TC3  0.435 -0.080  -0.080   -0.119
## 122                 TC9 ~~                 TC4  0.544 -0.043  -0.043   -0.144
## 123                 TC9 ~~                 TC5  1.292  0.073   0.073    0.232
## 124                 TC9 ~~                 TC6  1.254  0.094   0.094    0.206
## 125                 TC9 ~~                 TC7  0.379 -0.043  -0.043   -0.137
## 126                 TC9 ~~                TC11  4.373 -0.075  -0.075       NA
## 127                TC10 ~~                 TC3  0.657 -0.175  -0.175   -0.126
## 128                TC10 ~~                 TC4  0.526  0.075   0.075    0.122
## 129                TC10 ~~                 TC5  0.023  0.017   0.017    0.027
## 130                TC10 ~~                 TC6  0.285 -0.080  -0.080   -0.085
## 131                TC10 ~~                 TC7  2.648 -0.203  -0.203   -0.313
## 132                TC10 ~~                TC11  0.938  0.059   0.059       NA
## 133                 TC3 ~~                 TC4  0.001 -0.006  -0.006   -0.006
## 134                 TC3 ~~                 TC5  6.253 -0.543  -0.543   -0.455
## 135                 TC3 ~~                 TC6  0.464  0.188   0.188    0.108
## 136                 TC3 ~~                 TC7  4.539  0.524   0.524    0.438
## 137                 TC3 ~~                TC11  1.796  0.150   0.150       NA
## 138                 TC4 ~~                 TC5  2.983 -0.255  -0.255   -0.482
## 139                 TC4 ~~                 TC6  5.036  0.312   0.312    0.405
## 140                 TC4 ~~                 TC7  0.300 -0.103  -0.103   -0.194
## 141                 TC4 ~~                TC11  0.251 -0.027  -0.027       NA
## 142                 TC5 ~~                 TC6  0.775 -0.141  -0.141   -0.173
## 143                 TC5 ~~                 TC7  1.960  0.355   0.355    0.636
## 144                 TC5 ~~                TC11  0.058  0.014   0.014       NA
## 145                 TC6 ~~                 TC7  0.011  0.020   0.020    0.024
## 146                 TC6 ~~                TC11  2.793 -0.129  -0.129       NA
## 147                 TC7 ~~                TC11  0.183  0.028   0.028       NA
## 152    Student_Learning ~~              Change  0.127 -0.033  -0.532   -0.532
## 153    Student_Learning ~~              School  0.001  0.000  -0.019   -0.019
## 154    Student_Learning ~~ Teaching_profession  0.236  0.051   1.109    1.109
## 155              Change ~~              School  0.236  0.008   0.105    0.105
## 156              Change ~~ Teaching_profession  0.001 -0.003  -0.013   -0.013
## 157              School ~~ Teaching_profession  0.127 -0.004  -0.076   -0.076
##     sepc.nox
## 34    -2.981
## 35    -2.142
## 36    19.715
## 37    -0.627
## 38     0.466
## 39     0.086
## 40    -0.059
## 41     0.183
## 42     0.314
## 43    -0.419
## 44    -0.260
## 46    -0.708
## 47     0.546
## 48     0.071
## 49    -0.071
## 50     0.178
## 51     0.296
## 52    -0.396
## 53    -0.248
## 54     2.993
## 55    -0.190
## 56     0.038
## 57     0.067
## 58    -0.105
## 59     0.214
## 60     0.290
## 61    -0.226
## 62    -0.281
## 63    -0.011
## 64     0.252
## 65     0.114
## 66    -0.131
## 67     0.029
## 68     0.055
## 69    -0.199
## 70    -0.051
## 71    -0.337
## 72    -0.357
## 73     0.849
## 74     0.139
## 75    -0.195
## 76     0.159
## 77     0.097
## 78     0.068
## 79     0.208
## 80    -0.426
## 81    -0.105
## 82     0.556
## 83    -0.421
## 84    -0.568
## 85     0.541
## 86    -0.427
## 87    -0.118
## 88    -0.132
## 89     0.409
## 90     0.039
## 91    -0.010
## 92        NA
## 93    -0.606
## 94    -0.096
## 95     0.266
## 96    -0.394
## 97     0.219
## 98     0.098
## 99    -0.104
## 100    0.215
## 101    0.009
## 102       NA
## 103   -0.372
## 104    0.053
## 105    0.572
## 106   -0.304
## 107    0.150
## 108   -0.147
## 109   -0.286
## 110   -0.114
## 111       NA
## 112    0.536
## 113    0.402
## 114    0.087
## 115    0.300
## 116   -0.066
## 117   -0.138
## 118    0.002
## 119       NA
## 120   -0.358
## 121   -0.119
## 122   -0.144
## 123    0.232
## 124    0.206
## 125   -0.137
## 126       NA
## 127   -0.126
## 128    0.122
## 129    0.027
## 130   -0.085
## 131   -0.313
## 132       NA
## 133   -0.006
## 134   -0.455
## 135    0.108
## 136    0.438
## 137       NA
## 138   -0.482
## 139    0.405
## 140   -0.194
## 141       NA
## 142   -0.173
## 143    0.636
## 144       NA
## 145    0.024
## 146       NA
## 147       NA
## 152   -0.532
## 153   -0.019
## 154    1.109
## 155    0.105
## 156   -0.013
## 157   -0.076
library("lavaanPlot")
lavaanPlot(model=fit_cfa,node_options=list(shape="box",fontname="Helvetica"),edge_options=list(color="blue"),coefs=TRUE, covs=TRUE, stars=c("regress"),stand = FALSE)

Based on the results, we do not use the CFA’s result due to the small sample size.

Part 2 Rasch Analysis

Prepare the package

## Running the Rasch Rating Scale Model
library(TAM) # For running the Rating Scale Rasch Model
## Loading required package: CDM
## Loading required package: mvtnorm
## **********************************
## ** CDM 7.5-15 (2020-03-10 14:19:21)      
## ** Cognitive Diagnostic Models  **
## **********************************
## 
## Attaching package: 'CDM'
## The following object is masked from 'package:car':
## 
##     deltaMethod
## * TAM 3.5-19 (2020-05-05 22:45:39)
library(plyr) # For plot the Item characteristic curves
## 
## Attaching package: 'plyr'
## The following objects are masked from 'package:Hmisc':
## 
##     is.discrete, summarize
library(WrightMap)# For plot the variable map
library(eRm) # For another example
## 
## Attaching package: 'eRm'
## The following object is masked from 'package:psych':
## 
##     sim.rasch

Run the Partial Credit Model

# Run the Partial Credit Model
recoded_TCS_data1 <- recoded_TCS_data[-7,]
PC_model <- PCM(recoded_TCS_data1)
## Warning: 
## The following items have no 0-responses:
## TC1 TC2 TC3 TC4 TC5 TC6 TC7 TC8 TC9 TC10 TC11 TC12
## Responses are shifted such that lowest category is 0.
# Check the result
summary(PC_model)
## 
## Results of PCM estimation: 
## 
## Call:  PCM(X = recoded_TCS_data1) 
## 
## Conditional log-likelihood: -484.9877 
## Number of iterations: 49 
## Number of parameters: 41 
## 
## Item (Category) Difficulty Parameters (eta): with 0.95 CI:
##         Estimate Std. Error lower CI upper CI
## TC1.c2    -1.769      1.037   -3.802    0.263
## TC1.c3    -1.852      1.001   -3.815    0.110
## TC1.c4     0.792      1.085   -1.334    2.918
## TC2.c1    -1.526      1.069   -3.622    0.570
## TC2.c2    -2.321      1.008   -4.298   -0.345
## TC2.c3    -0.454      1.041   -2.495    1.586
## TC3.c1     0.352      0.583   -0.791    1.495
## TC3.c2     0.601      0.567   -0.510    1.713
## TC3.c3     1.570      0.622    0.352    2.788
## TC3.c4     2.654      0.689    1.304    4.004
## TC3.c5     3.971      0.790    2.422    5.519
## TC4.c1    -0.242      0.558   -1.336    0.853
## TC4.c2    -0.085      0.553   -1.169    0.998
## TC4.c3     1.621      0.654    0.339    2.903
## TC5.c1    -0.407      0.710   -1.799    0.985
## TC5.c2    -0.627      0.663   -1.928    0.673
## TC5.c3     0.211      0.691   -1.142    1.565
## TC5.c4     2.397      0.835    0.761    4.034
## TC6.c1    -0.681      0.679   -2.012    0.651
## TC6.c2    -0.365      0.675   -1.688    0.958
## TC6.c3     0.390      0.698   -0.977    1.758
## TC6.c4     1.867      0.774    0.349    3.385
## TC7.c1     0.388      0.586   -0.762    1.537
## TC7.c2     0.472      0.555   -0.616    1.560
## TC7.c3     1.101      0.587   -0.050    2.252
## TC7.c4     3.301      0.766    1.800    4.802
## TC8.c1     0.339      0.716   -1.065    1.743
## TC8.c2    -0.650      0.596   -1.818    0.517
## TC8.c3     0.768      0.663   -0.531    2.067
## TC9.c1    -1.180      0.783   -2.714    0.355
## TC9.c2    -1.150      0.765   -2.650    0.349
## TC9.c3    -0.023      0.798   -1.586    1.541
## TC10.c1   -1.042      1.141   -3.279    1.194
## TC10.c2   -1.804      1.037   -3.837    0.230
## TC10.c3   -1.656      1.008   -3.632    0.320
## TC10.c4   -0.073      1.026   -2.084    1.938
## TC11.c1   -0.353      0.432   -1.199    0.494
## TC11.c2    1.044      0.513    0.039    2.049
## TC12.c1   -1.543      1.070   -3.640    0.553
## TC12.c2   -2.225      1.012   -4.210   -0.241
## TC12.c3   -0.782      1.030   -2.800    1.237
## 
## Item Easiness Parameters (beta) with 0.95 CI:
##              Estimate Std. Error lower CI upper CI
## beta TC1.c1     1.028      1.141   -1.209    3.265
## beta TC1.c2     1.769      1.037   -0.263    3.802
## beta TC1.c3     1.852      1.001   -0.110    3.815
## beta TC1.c4    -0.792      1.085   -2.918    1.334
## beta TC2.c1     1.526      1.069   -0.570    3.622
## beta TC2.c2     2.321      1.008    0.345    4.298
## beta TC2.c3     0.454      1.041   -1.586    2.495
## beta TC3.c1    -0.352      0.583   -1.495    0.791
## beta TC3.c2    -0.601      0.567   -1.713    0.510
## beta TC3.c3    -1.570      0.622   -2.788   -0.352
## beta TC3.c4    -2.654      0.689   -4.004   -1.304
## beta TC3.c5    -3.971      0.790   -5.519   -2.422
## beta TC4.c1     0.242      0.558   -0.853    1.336
## beta TC4.c2     0.085      0.553   -0.998    1.169
## beta TC4.c3    -1.621      0.654   -2.903   -0.339
## beta TC5.c1     0.407      0.710   -0.985    1.799
## beta TC5.c2     0.627      0.663   -0.673    1.928
## beta TC5.c3    -0.211      0.691   -1.565    1.142
## beta TC5.c4    -2.397      0.835   -4.034   -0.761
## beta TC6.c1     0.681      0.679   -0.651    2.012
## beta TC6.c2     0.365      0.675   -0.958    1.688
## beta TC6.c3    -0.390      0.698   -1.758    0.977
## beta TC6.c4    -1.867      0.774   -3.385   -0.349
## beta TC7.c1    -0.388      0.586   -1.537    0.762
## beta TC7.c2    -0.472      0.555   -1.560    0.616
## beta TC7.c3    -1.101      0.587   -2.252    0.050
## beta TC7.c4    -3.301      0.766   -4.802   -1.800
## beta TC8.c1    -0.339      0.716   -1.743    1.065
## beta TC8.c2     0.650      0.596   -0.517    1.818
## beta TC8.c3    -0.768      0.663   -2.067    0.531
## beta TC9.c1     1.180      0.783   -0.355    2.714
## beta TC9.c2     1.150      0.765   -0.349    2.650
## beta TC9.c3     0.023      0.798   -1.541    1.586
## beta TC10.c1    1.042      1.141   -1.194    3.279
## beta TC10.c2    1.804      1.037   -0.230    3.837
## beta TC10.c3    1.656      1.008   -0.320    3.632
## beta TC10.c4    0.073      1.026   -1.938    2.084
## beta TC11.c1    0.353      0.432   -0.494    1.199
## beta TC11.c2   -1.044      0.513   -2.049   -0.039
## beta TC12.c1    1.543      1.070   -0.553    3.640
## beta TC12.c2    2.225      1.012    0.241    4.210
## beta TC12.c3    0.782      1.030   -1.237    2.800
# Plot the Variable Map
plotPImap(PC_model)

### Examine item difficulty values:
item.estimates <- thresholds(PC_model)
item.estimates
## 
## Design Matrix Block 1:
##      Location Threshold 1 Threshold 2 Threshold 3 Threshold 4 Threshold 5
## TC1   0.19805    -1.02791    -0.74138    -0.08310     2.64459          NA
## TC2  -0.15148    -1.52601    -0.79518     1.86674          NA          NA
## TC3   0.79411     0.35194     0.24929     0.96874     1.08393     1.31666
## TC4   0.54035    -0.24174     0.15661     1.70618          NA          NA
## TC5   0.59934    -0.40724    -0.22002     0.83859     2.18605          NA
## TC6   0.46674    -0.68062     0.31570     0.75530     1.47660          NA
## TC7   0.82521     0.38756     0.08481     0.62866     2.19982          NA
## TC8   0.25602     0.33866    -0.98916     1.41855          NA          NA
## TC9  -0.00756    -1.17958     0.02919     1.12771          NA          NA
## TC10 -0.01822    -1.04234    -0.76118     0.14749     1.58312          NA
## TC11  0.52187    -0.35264     1.39638          NA          NA          NA
## TC12 -0.26055    -1.54339    -0.68201     1.44375          NA          NA
## Get threshold SEs values:
item.se <- item.estimates$se.thresh
item.se
##  thresh beta TC1.c1  thresh beta TC1.c2  thresh beta TC1.c3  thresh beta TC1.c4 
##           1.1413654           0.6802707           0.4015551           0.5534176 
##  thresh beta TC2.c1  thresh beta TC2.c2  thresh beta TC2.c3  thresh beta TC3.c1 
##           1.0693218           0.4775345           0.4080593           0.5831876 
##  thresh beta TC3.c2  thresh beta TC3.c3  thresh beta TC3.c4  thresh beta TC3.c5 
##           0.5458626           0.5033656           0.5343557           0.6002664 
##  thresh beta TC4.c1  thresh beta TC4.c2  thresh beta TC4.c3  thresh beta TC5.c1 
##           0.5584964           0.4171829           0.4433559           0.7102064 
##  thresh beta TC5.c2  thresh beta TC5.c3  thresh beta TC5.c4  thresh beta TC6.c1 
##           0.5089525           0.3997560           0.5791396           0.6792984 
##  thresh beta TC6.c2  thresh beta TC6.c3  thresh beta TC6.c4  thresh beta TC7.c1 
##           0.4854199           0.4376947           0.4926988           0.5864065 
##  thresh beta TC7.c2  thresh beta TC7.c3  thresh beta TC7.c4  thresh beta TC8.c1 
##           0.5268677           0.4242842           0.5793449           0.7163118 
##  thresh beta TC8.c2  thresh beta TC8.c3  thresh beta TC9.c1  thresh beta TC9.c2 
##           0.5659673           0.3837813           0.7828900           0.4352110 
##  thresh beta TC9.c3 thresh beta TC10.c1 thresh beta TC10.c2 thresh beta TC10.c3 
##           0.3905283           1.1411925           0.6806943           0.4164053 
## thresh beta TC10.c4 thresh beta TC11.c1 thresh beta TC11.c2 thresh beta TC12.c1 
##           0.4272984           0.4320528           0.3840091           1.0697657 
## thresh beta TC12.c2 thresh beta TC12.c3 
##           0.4835519           0.3806361
# Standard errors for theta estimates:
person.locations.estimate <- person.parameter(PC_model)
summary(person.locations.estimate)
## 
## Estimation of Ability Parameters
## 
## Collapsed log-likelihood: -220.7884 
## Number of iterations: 7 
## Number of parameters: 16 
## 
## ML estimated ability parameters (without spline interpolated values): 
##              Estimate Std. Err.       2.5 %     97.5 %
## theta P1   0.20720166 0.3064184 -0.39336740  0.8077707
## theta P2   0.88190897 0.3215480  0.25168643  1.5121315
## theta P3   1.33622888 0.3568839  0.63674928  2.0357085
## theta P4   1.46847406 0.3708533  0.74161498  2.1953331
## theta P5   0.39482394 0.3066165 -0.20613334  0.9957812
## theta P6   1.21309601 0.3452815  0.53635678  1.8898352
## theta P7   0.20720166 0.3064184 -0.39336740  0.8077707
## theta P8  -0.27558916 0.3180247 -0.89890604  0.3477277
## theta P9  -0.27558916 0.3180247 -0.89890604  0.3477277
## theta P10  0.88190897 0.3215480  0.25168643  1.5121315
## theta P11  0.11306122 0.3073366 -0.48930751  0.7154300
## theta P12  1.33622888 0.3568839  0.63674928  2.0357085
## theta P13  0.39482394 0.3066165 -0.20613334  0.9957812
## theta P14  1.09726443 0.3357044  0.43929581  1.7552330
## theta P15  1.21309601 0.3452815  0.53635678  1.8898352
## theta P16  0.68127579 0.3126566  0.06848016  1.2940714
## theta P17  1.21309601 0.3452815  0.53635678  1.8898352
## theta P18  0.88190897 0.3215480  0.25168643  1.5121315
## theta P19  0.11306122 0.3073366 -0.48930751  0.7154300
## theta P20  0.68127579 0.3126566  0.06848016  1.2940714
## theta P21  0.88190897 0.3215480  0.25168643  1.5121315
## theta P22  0.88190897 0.3215480  0.25168643  1.5121315
## theta P23  0.88190897 0.3215480  0.25168643  1.5121315
## theta P24  1.33622888 0.3568839  0.63674928  2.0357085
## theta P25  0.58446795 0.3097829 -0.02269541  1.1916313
## theta P26 -0.48417652 0.3285324 -1.12808822  0.1597352
## theta P27 -0.07795328 0.3112001 -0.68789422  0.5319877
## theta P28 -1.10262678 0.3833805 -1.85403883 -0.3512147
## theta P29  1.46847406 0.3708533  0.74161498  2.1953331
## theta P30  1.09726443 0.3357044  0.43929581  1.7552330
## theta P31  1.77006026 0.4077880  0.97081050  2.5693100
## theta P32  0.58446795 0.3097829 -0.02269541  1.1916313
## theta P33  1.09726443 0.3357044  0.43929581  1.7552330
## theta P34  0.88190897 0.3215480  0.25168643  1.5121315
## theta P35  0.68127579 0.3126566  0.06848016  1.2940714
## theta P36  1.33622888 0.3568839  0.63674928  2.0357085
## theta P37  1.46847406 0.3708533  0.74161498  2.1953331
## theta P38  0.88190897 0.3215480  0.25168643  1.5121315
## theta P39  0.78018832 0.3165323  0.15979639  1.4005803
## theta P40  1.46847406 0.3708533  0.74161498  2.1953331
## theta P41  0.58446795 0.3097829 -0.02269541  1.1916313
# Build a table for person locations
person_theta <- person.locations.estimate$theta.table
person_theta
##     Person Parameter NAgroup Interpolated
## P1        0.20720166       1        FALSE
## P2        0.88190897       1        FALSE
## P3        1.33622888       1        FALSE
## P4        1.46847406       1        FALSE
## P5        0.39482394       1        FALSE
## P6        1.21309601       1        FALSE
## P7        0.20720166       1        FALSE
## P8       -0.27558916       1        FALSE
## P9       -0.27558916       1        FALSE
## P10       0.88190897       1        FALSE
## P11       0.11306122       1        FALSE
## P12       1.33622888       1        FALSE
## P13       0.39482394       1        FALSE
## P14       1.09726443       1        FALSE
## P15       1.21309601       1        FALSE
## P16       0.68127579       1        FALSE
## P17       1.21309601       1        FALSE
## P18       0.88190897       1        FALSE
## P19       0.11306122       1        FALSE
## P20       0.68127579       1        FALSE
## P21       0.88190897       1        FALSE
## P22       0.88190897       1        FALSE
## P23       0.88190897       1        FALSE
## P24       1.33622888       1        FALSE
## P25       0.58446795       1        FALSE
## P26      -0.48417652       1        FALSE
## P27      -0.07795328       1        FALSE
## P28      -1.10262678       1        FALSE
## P29       1.46847406       1        FALSE
## P30       1.09726443       1        FALSE
## P31       1.77006026       1        FALSE
## P32       0.58446795       1        FALSE
## P33       1.09726443       1        FALSE
## P34       0.88190897       1        FALSE
## P35       0.68127579       1        FALSE
## P36       1.33622888       1        FALSE
## P37       1.46847406       1        FALSE
## P38       0.88190897       1        FALSE
## P39       0.78018832       1        FALSE
## P40       1.46847406       1        FALSE
## P41       0.58446795       1        FALSE
item.fit <- itemfit(person.locations.estimate)
item.fit
## 
## Itemfit Statistics: 
##       Chisq df p-value Outfit MSQ Infit MSQ Outfit t Infit t Discrim
## TC1  37.837 40   0.568      0.923     0.905   -0.217  -0.310   0.580
## TC2  32.833 40   0.782      0.801     0.771   -0.833  -0.980   0.613
## TC3  74.449 40   0.001      1.816     1.627    3.226   2.774  -0.011
## TC4  31.673 40   0.824      0.773     0.740   -1.163  -1.388   0.584
## TC5  33.417 40   0.760      0.815     0.768   -0.867  -1.140   0.621
## TC6  54.251 40   0.066      1.323     1.283    1.555   1.408   0.143
## TC7  36.148 40   0.644      0.882     0.867   -0.501  -0.622   0.482
## TC8  29.336 40   0.893      0.716     0.713   -1.196  -1.304   0.736
## TC9  29.727 40   0.883      0.725     0.708   -1.454  -1.581   0.743
## TC10 58.231 40   0.031      1.420     1.307    1.740   1.334   0.193
## TC11 31.385 40   0.833      0.765     0.771   -1.383  -1.353   0.662
## TC12 27.339 40   0.936      0.667     0.674   -1.663  -1.605   0.795
item.fit.table <- cbind(item.fit[["i.outfitMSQ"]],item.fit[["i.infitMSQ"]],item.fit[["i.infitMSQ"]],item.fit[["i.infitZ"]])
pfit <- personfit(person.locations.estimate)
pfit
## 
## Personfit Statistics: 
##      Chisq df p-value Outfit MSQ Infit MSQ Outfit t Infit t
## P1   7.456 11   0.761      0.621     0.697    -1.09   -0.77
## P2   2.839 11   0.993      0.237     0.432    -2.70   -1.64
## P3  24.373 11   0.011      2.031     1.902     2.02    1.71
## P4  16.355 11   0.128      1.363     1.317     0.90    0.77
## P5   3.192 11   0.988      0.266     0.347    -2.74   -2.19
## P6   3.873 11   0.973      0.323     0.389    -2.10   -1.67
## P7   9.466 11   0.579      0.789     0.855    -0.50   -0.28
## P8   5.892 11   0.880      0.491     0.479    -1.64   -1.63
## P9  28.227 11   0.003      2.352     2.624     2.86    3.18
## P10 12.877 11   0.301      1.073     1.131     0.31    0.44
## P11  9.071 11   0.615      0.756     0.781    -0.62   -0.51
## P12  8.354 11   0.681      0.696     0.751    -0.66   -0.44
## P13  9.131 11   0.610      0.761     0.662    -0.57   -0.88
## P14 14.464 11   0.208      1.205     1.819     0.60    1.67
## P15  1.582 11   1.000      0.132     0.140    -3.37   -3.09
## P16  9.146 11   0.608      0.762     0.886    -0.53   -0.17
## P17 20.200 11   0.043      1.683     2.397     1.49    2.43
## P18  4.638 11   0.947      0.387     0.359    -1.88   -1.97
## P19 21.816 11   0.026      1.818     1.930     1.95    2.08
## P20  1.937 11   0.999      0.161     0.252    -3.36   -2.65
## P21  4.555 11   0.951      0.380     0.458    -1.92   -1.53
## P22  3.729 11   0.977      0.311     0.316    -2.26   -2.18
## P23 13.063 11   0.289      1.089     1.356     0.35    0.91
## P24 29.209 11   0.002      2.434     3.175     2.58    3.22
## P25 29.776 11   0.002      2.481     1.747     2.88    1.69
## P26 13.865 11   0.241      1.155     1.073     0.52    0.31
## P27 10.024 11   0.528      0.835     0.890    -0.37   -0.18
## P28  7.019 11   0.798      0.585     0.605    -0.88   -0.93
## P29 23.539 11   0.015      1.962     2.090     1.90    1.93
## P30 23.380 11   0.016      1.948     1.825     1.94    1.68
## P31 11.729 11   0.384      0.977     0.873     0.10   -0.10
## P32  4.931 11   0.934      0.411     0.323    -1.87   -2.27
## P33 11.874 11   0.373      0.990     1.788     0.11    1.63
## P34  9.712 11   0.556      0.809     0.873    -0.37   -0.18
## P35  1.654 11   0.999      0.138     0.137    -3.57   -3.52
## P36  8.399 11   0.677      0.700     0.798    -0.65   -0.32
## P37 19.566 11   0.052      1.630     1.586     1.38    1.21
## P38  5.865 11   0.882      0.489     0.490    -1.44   -1.40
## P39  8.535 11   0.665      0.711     0.738    -0.68   -0.58
## P40  5.095 11   0.926      0.425     0.489    -1.59   -1.19
## P41 16.217 11   0.133      1.351     1.498     0.95    1.23
person.fit.table <- cbind(pfit[["p.outfitMSQ"]],pfit[["p.outfitMSQ"]],pfit[["p.outfitMSQ"]],pfit[["p.outfitMSQ"]])

# ===================================
# compute item separation reliability
# ===================================

# Get Item scores
ItemScores <- colSums(recoded_TCS_data)

# Get Item SD
ItemSD <- apply(recoded_TCS_data,2,sd)

# Calculate the se of the Item
ItemSE <- ItemSD/sqrt(length(ItemSD))

# compute the Observed Variance (also known as Total Person Variability or Squared Standard Deviation)
SSD.ItemScores <- var(ItemScores)

# compute the Mean Square Measurement error (also known as Model Error variance)
Item.MSE <- sum((ItemSE)^2) / length(ItemSE)

# compute the Item Separation Reliability
item.separation.reliability <- (SSD.ItemScores-Item.MSE) / SSD.ItemScores
item.separation.reliability
## [1] 0.9997966
# ===================================
# compute person separation reliability
# ===================================

# Get Person scores
PersonScores <- rowSums(recoded_TCS_data)

# Get Person SD
PersonSD <- apply(recoded_TCS_data,1,sd)

# Calculate the se of the Person
PersonSE <- PersonSD/sqrt(length(PersonSD))

# compute the Observed Variance (also known as Total Person Variability or Squared Standard Deviation)
SSD.PersonScores <- var(PersonScores)

# compute the Mean Square Measurement error (also known as Model Error variance)
Person.MSE <- sum((PersonSE)^2) / length(PersonSE)

# compute the Person Separation Reliability
person.separation.reliability <- (SSD.PersonScores-Person.MSE) / SSD.PersonScores
person.separation.reliability
## [1] 0.9993899