data<-read.csv("/Users/levibrackman/Dropbox/Git/stats/Schools Study/Students self assessment data.csv")
require(dplyr)
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
sectionone<-select(data, MLQ_1_1,   MLQ_4_1,    MLQ_5_1,    MLQ_6_1,    MLQ_11_1)
sectiononecomp<- sectionone[complete.cases(sectionone[,]),]

Analysis of Purpsoe Navigator data with meaning purpose as two factors

## Loading required package: lavaan
## This is lavaan 0.5-20
## lavaan is BETA software! Please report any bugs.
## Warning in lav_data_full(data = data, group = group, group.label =
## group.label, : lavaan WARNING: unordered factor(s) with more than 2 levels
## detected in data: MLQ_1_1 MLQ_5_1 MLQ_4_1 MLQ_6_1 MLQ_11_1
## Loading required package: semPlot

## lavaan (0.5-20) converged normally after  54 iterations
## 
##   Number of observations                           748
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic               15.561
##   Degrees of freedom                                 4
##   P-value (Chi-square)                           0.004
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Standard Errors                             Standard
## 
## Latent Variables:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   Purpose =~                                                            
##     MLQ_1_1           1.000                               3.653    0.945
##     MLQ_5_1           1.151    0.022   52.256    0.000    4.204    0.936
##   Meaning =~                                                            
##     MLQ_4_1           1.000                               4.084    0.963
##     MLQ_6_1           0.998    0.017   60.080    0.000    4.078    0.946
##     MLQ_11_1          0.805    0.017   46.078    0.000    3.288    0.891
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   Purpose ~~                                                            
##     Meaning          14.876    0.809   18.382    0.000    0.997    0.997
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     MLQ_1_1           1.612    0.118   13.684    0.000    1.612    0.108
##     MLQ_5_1           2.493    0.170   14.698    0.000    2.493    0.124
##     MLQ_4_1           1.319    0.105   12.528    0.000    1.319    0.073
##     MLQ_6_1           1.950    0.131   14.858    0.000    1.950    0.105
##     MLQ_11_1          2.807    0.161   17.384    0.000    2.807    0.206
##     Purpose          13.346    0.773   17.255    0.000    1.000    1.000
##     Meaning          16.679    0.932   17.904    0.000    1.000    1.000
## 
## R-Square:
##                    Estimate
##     MLQ_1_1           0.892
##     MLQ_5_1           0.876
##     MLQ_4_1           0.927
##     MLQ_6_1           0.895
##     MLQ_11_1          0.794
## $type
## [1] "cor.bollen"
## 
## $cor
##          MLQ_1_ MLQ_5_ MLQ_4_ MLQ_6_ MLQ_11
## MLQ_1_1   0.000                            
## MLQ_5_1   0.000  0.000                     
## MLQ_4_1  -0.003  0.007  0.000              
## MLQ_6_1   0.003 -0.009  0.000  0.000       
## MLQ_11_1  0.003 -0.003 -0.006  0.009  0.000
## 
## $mean
##  MLQ_1_1  MLQ_5_1  MLQ_4_1  MLQ_6_1 MLQ_11_1 
##        0        0        0        0        0
## $type
## [1] "standardized"
## 
## $cov
##          MLQ_1_ MLQ_5_ MLQ_4_ MLQ_6_ MLQ_11
## MLQ_1_1   0.000                            
## MLQ_5_1   0.000  0.000                     
## MLQ_4_1      NA  1.570  0.000              
## MLQ_6_1   0.816     NA  0.026     NA       
## MLQ_11_1  0.551 -0.761     NA  1.461     NA
## 
## $mean
##  MLQ_1_1  MLQ_5_1  MLQ_4_1  MLQ_6_1 MLQ_11_1 
##        0        0        0        0        0
## Found more than one class "Model" in cache; using the first, from namespace 'lavaan'
##        lhs op      rhs     mi    epc sepc.lv sepc.all sepc.nox
## 23 MLQ_5_1 ~~  MLQ_4_1 13.353  0.432   0.432    0.023    0.023
## 24 MLQ_5_1 ~~  MLQ_6_1 10.561 -0.397  -0.397   -0.021   -0.021
## 14 Purpose =~  MLQ_4_1  4.616  3.366  12.297    2.899    2.899
## 28 MLQ_6_1 ~~ MLQ_11_1  4.616  0.236   0.236    0.015    0.015
## 15 Purpose =~  MLQ_6_1  4.203 -3.021 -11.036   -2.560   -2.560
## 27 MLQ_4_1 ~~ MLQ_11_1  4.203 -0.213  -0.213   -0.014   -0.014

Analysis of Purpsoe Navigator data with purpose as one factors

## Warning in lav_data_full(data = data, group = group, group.label =
## group.label, : lavaan WARNING: unordered factor(s) with more than 2 levels
## detected in data: MLQ_1_1 MLQ_5_1 MLQ_4_1 MLQ_6_1 MLQ_11_1

## lavaan (0.5-20) converged normally after  34 iterations
## 
##   Number of observations                           748
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic               16.300
##   Degrees of freedom                                 5
##   P-value (Chi-square)                           0.006
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Standard Errors                             Standard
## 
## Latent Variables:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   Purpose =~                                                            
##     MLQ_1_1           1.000                               3.647    0.943
##     MLQ_5_1           1.151    0.022   51.719    0.000    4.197    0.935
##     MLQ_4_1           1.119    0.019   58.995    0.000    4.082    0.962
##     MLQ_6_1           1.117    0.021   54.343    0.000    4.075    0.946
##     MLQ_11_1          0.901    0.021   43.348    0.000    3.287    0.891
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     MLQ_1_1           1.654    0.108   15.282    0.000    1.654    0.111
##     MLQ_5_1           2.545    0.160   15.863    0.000    2.545    0.126
##     MLQ_4_1           1.335    0.102   13.022    0.000    1.335    0.074
##     MLQ_6_1           1.968    0.131   15.074    0.000    1.968    0.106
##     MLQ_11_1          2.813    0.161   17.438    0.000    2.813    0.207
##     Purpose          13.304    0.772   17.242    0.000    1.000    1.000
## 
## R-Square:
##                    Estimate
##     MLQ_1_1           0.889
##     MLQ_5_1           0.874
##     MLQ_4_1           0.926
##     MLQ_6_1           0.894
##     MLQ_11_1          0.793
## $type
## [1] "cor.bollen"
## 
## $cor
##          MLQ_1_ MLQ_5_ MLQ_4_ MLQ_6_ MLQ_11
## MLQ_1_1   0.000                            
## MLQ_5_1   0.003  0.000                     
## MLQ_4_1  -0.004  0.006  0.000              
## MLQ_6_1   0.002 -0.010  0.001  0.000       
## MLQ_11_1  0.002 -0.004 -0.006  0.010  0.000
## 
## $mean
##  MLQ_1_1  MLQ_5_1  MLQ_4_1  MLQ_6_1 MLQ_11_1 
##        0        0        0        0        0
## $type
## [1] "standardized"
## 
## $cov
##          MLQ_1_ MLQ_5_ MLQ_4_ MLQ_6_ MLQ_11
## MLQ_1_1   0.000                            
## MLQ_5_1   0.674     NA                     
## MLQ_4_1      NA  1.423     NA              
## MLQ_6_1   0.639     NA  0.401     NA       
## MLQ_11_1  0.384 -1.046     NA  1.524     NA
## 
## $mean
##  MLQ_1_1  MLQ_5_1  MLQ_4_1  MLQ_6_1 MLQ_11_1 
##        0        0        0        0        0
##        lhs op      rhs     mi    epc sepc.lv sepc.all sepc.nox
## 17 MLQ_5_1 ~~  MLQ_6_1 10.939 -0.381  -0.381   -0.020   -0.020
## 16 MLQ_5_1 ~~  MLQ_4_1  8.585  0.320   0.320    0.017    0.017
## 21 MLQ_6_1 ~~ MLQ_11_1  5.084  0.244   0.244    0.015    0.015

Compare with other MLQ from large youth dataset with negatively worded item

data <- read.csv("~/Dropbox/Git/stats/allsurveysYT1_Jan2016.csv", header=T)
data<-tbl_df(data)
MLQ<-select(data, MLQ_1, MLQ_2, MLQ_3, MLQ_4, MLQ_5, MLQ_6,MLQ_7, MLQ_8, MLQ_9, MLQ_10)
MLQ$MLQ_9  <-  8- MLQ$MLQ_9
purposemodelMLQ= ' Purpose  =~ MLQ_1 + MLQ_5 + MLQ_4 + MLQ_6 + MLQ_9'
purposefit1=cfa(purposemodelMLQ, data=MLQ)
require(semPlot)
semPaths(purposefit1, whatLabels = "std", layout = "tree")

summary(purposefit1, standardized = TRUE, rsquare=TRUE)
## lavaan (0.5-20) converged normally after  25 iterations
## 
##                                                   Used       Total
##   Number of observations                           970        1288
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic               33.938
##   Degrees of freedom                                 5
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Standard Errors                             Standard
## 
## Latent Variables:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   Purpose =~                                                            
##     MLQ_1             1.000                               1.398    0.813
##     MLQ_5             0.825    0.032   25.569    0.000    1.154    0.781
##     MLQ_4             0.899    0.035   25.729    0.000    1.257    0.785
##     MLQ_6             0.947    0.037   25.872    0.000    1.324    0.789
##     MLQ_9             0.563    0.047   12.037    0.000    0.788    0.401
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     MLQ_1             1.000    0.064   15.566    0.000    1.000    0.338
##     MLQ_5             0.851    0.050   16.882    0.000    0.851    0.390
##     MLQ_4             0.983    0.059   16.729    0.000    0.983    0.383
##     MLQ_6             1.062    0.064   16.586    0.000    1.062    0.377
##     MLQ_9             3.246    0.152   21.416    0.000    3.246    0.840
##     Purpose           1.955    0.134   14.567    0.000    1.000    1.000
## 
## R-Square:
##                    Estimate
##     MLQ_1             0.662
##     MLQ_5             0.610
##     MLQ_4             0.617
##     MLQ_6             0.623
##     MLQ_9             0.160
correlMP = residuals(purposefit1, type="cor")
correlMP
## $type
## [1] "cor.bollen"
## 
## $cor
##       MLQ_1  MLQ_5  MLQ_4  MLQ_6  MLQ_9 
## MLQ_1  0.000                            
## MLQ_5  0.019  0.000                     
## MLQ_4 -0.021 -0.011  0.000              
## MLQ_6 -0.004 -0.018  0.037  0.000       
## MLQ_9  0.030  0.033 -0.007 -0.059  0.000
## 
## $mean
## MLQ_1 MLQ_5 MLQ_4 MLQ_6 MLQ_9 
##     0     0     0     0     0
zcorrelsMP = residuals(purposefit1, type = "standardized")
zcorrelsMP
## $type
## [1] "standardized"
## 
## $cov
##       MLQ_1  MLQ_5  MLQ_4  MLQ_6  MLQ_9 
## MLQ_1  0.000                            
## MLQ_5  2.272  0.000                     
## MLQ_4 -5.229 -1.657     NA              
## MLQ_6 -0.727 -3.039  3.585  0.000       
## MLQ_9  2.014  2.005 -0.439 -4.177     NA
## 
## $mean
## MLQ_1 MLQ_5 MLQ_4 MLQ_6 MLQ_9 
##     0     0     0     0     0
modindices(purposefit1, sort. = TRUE, minimum.value = 3.84)
##      lhs op   rhs     mi    epc sepc.lv sepc.all sepc.nox
## 19 MLQ_4 ~~ MLQ_6 23.755  0.258   0.258    0.096    0.096
## 21 MLQ_6 ~~ MLQ_9 14.849 -0.271  -0.271   -0.082   -0.082
## 13 MLQ_1 ~~ MLQ_4 10.238 -0.178  -0.178   -0.065   -0.065
## 12 MLQ_1 ~~ MLQ_5  8.034  0.145   0.145    0.057    0.057
## 17 MLQ_5 ~~ MLQ_6  5.668 -0.116  -0.116   -0.047   -0.047
## 15 MLQ_1 ~~ MLQ_9  4.485  0.150   0.150    0.044    0.044
## 18 MLQ_5 ~~ MLQ_9  4.384  0.131   0.131    0.045    0.045
options(scipen=999)
MLQpurpose_fit<-fitmeasures(purposefit1)[c('chisq', 'df', 'pvalue', 'cfi', 'rmsea', 'srmr', 'tli')]#Models purpose and meaning

Table of Fit Measures

Colunm names explained:

It seems that when we have a positive question instead of the negatively worded one we get a much better fit for the data.

## Source: local data frame [7 x 4]
## 
##   Fit_Measure      MLQ_With_9 Meaning_Purpose_PN   Purpose_PN
##        (fctr)           (dbl)              (dbl)        (dbl)
## 1       Chisq 33.937974012844       15.560836718 16.300424242
## 2          DF  5.000000000000        4.000000000  5.000000000
## 3     P-Value  0.000002449668        0.003668787  0.006036693
## 4         CFI  0.985671972577        0.997790999  0.997840758
## 5       RMSEA  0.077243721945        0.062160406  0.054968207
## 6        SRMR  0.023296983085        0.004403999  0.004560752
## 7         TLI  0.971343945155        0.994477498  0.995681515