#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05b.model<-'
FA=~NA*A1+A2+A3
FB=~NA*B1+B2+B3
FC=~NA*C1+C2+C3
FD=~NA*D1+D2+D3
FE=~NA*E1+E2+E3
FF=~NA*F1+F2+F3
FA~~1*FA
FB~~1*FB
FC~~1*FC
FD~~1*FD
FE~~1*FE
FF~~1*FF'
ch05.fit <- cfa(model=ch05b.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ A1 + A2 + A3
FB =~ B1 + B2 + B3
FC =~ C1 + C2 + C3
FD =~ D1 + D2 + D3
FE =~ E1 + E2 + E3
FF =~ F1 + F2 + F3'
ch05.fit <- cfa(model=ch05a.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ A1 + A2 + A3
FB =~ B1 + B2 + B3
FC =~ C1 + C2 + C3
FD =~ D1 + D2 + D3
FE =~ E1 + E2 + E3
FF =~ F1 + F2 + F3'
ch05.fit <- cfa(model=ch05a.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit)
semPaths(ch05.fit, 'est', 'std', mar = c(20, 1, 10, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ A1 + A2 + A3
FB =~ B1 + B2 + B3
FC =~ C1 + C2 + C3
FD =~ D1 + D2 + D3
FE =~ E1 + E2 + E3
FF =~ F1 + F2 + F3'
ch05.fit <- cfa(model=ch05a.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 10, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 10, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ A1 + A2 + A3
FB =~ B1 + B2 + B3
FC =~ C1 + C2 + C3
FD =~ D1 + D2 + D3
FE =~ E1 + E2 + E3
FF =~ F1 + F2 + F3'
ch05.fit <- cfa(model=ch05a.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 20, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
ch05.fit <- cfa(model=ch05a.model,
sample.cov=ch05.cov,
orthogonal = FALSE.
sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 20, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
ch05.fit <- cfa(model=ch05a.model,
sample.cov=ch05.cov,
orthogonal = FALSE.
sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 20, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
ch05.fit <- cfa(model=ch05a.model,
sample.cov=ch05.cov,
orthogonal = FALSE,
sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 20, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
ch05.fit <- cfa(model=ch05a.model,
sample.cov=ch05.cov,
orthogonal = TRUE,
sample.nobs=313)
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
ch05.fit <- cfa(model=ch05a.model,
sample.cov=ch05.cov,
orthogonal = TRUE,
sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
library(semPlot)
semPaths(ch05.fit, mar = c(20, 1, 20, 1))
semPaths(ch05.fit, 'std', mar = c(20, 1, 20, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05a.model<-'FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
ch05a.fit <- cfa(model=ch05a.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = FALSE)
ch05b.fit <- cfa(model=ch05a.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = TRUE)
inspect(ch05a.fit)
inspect(ch05b.fit)
summary(ch05a.fit, fit.measures=TRUE, standard=TRUE)
summary(ch05b.fit, fit.measures=TRUE, standard=TRUE)
modificationIndices(ch05a.fit)
library(semPlot)
semPaths(ch05a.fit, mar = c(20, 1, 20, 1))
semPaths(ch05a.fit, 'std', mar = c(20, 1, 20, 1))
semPaths(ch05b.fit, mar = c(20, 1, 20, 1))
semPaths(ch05b.fit, 'std', mar = c(20, 1, 20, 1))
library(semPlot)
semPaths(ch05a.fit, mar = c(30, 1, 30, 1))
semPaths(ch05a.fit, 'std', mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, 'std', mar = c(30, 1, 30, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05.model<-'
#define the measurement model
FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
#define CFA
ch05a.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = FALSE)
ch05b.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = TRUE)
inspect(ch05a.fit)
inspect(ch05b.fit)
summary(ch05a.fit, fit.measures=TRUE, standard=TRUE)
summary(ch05b.fit, fit.measures=TRUE, standard=TRUE)
modificationIndices(ch05a.fit)
library(semPlot)
semPaths(ch05a.fit, mar = c(30, 1, 30, 1))
semPaths(ch05a.fit, 'std', mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, 'std', mar = c(30, 1, 30, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\ch5.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05.model<-'
#define the measurement model
FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
#define CFA
ch05a.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = FALSE)
ch05b.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = TRUE)
inspect(ch05a.fit)
inspect(ch05b.fit)
summary(ch05a.fit, fit.measures=TRUE, standard=TRUE)
summary(ch05b.fit, fit.measures=TRUE, standard=TRUE)
modificationIndices(ch05a.fit)
library(semPlot)
semPaths(ch05a.fit, mar = c(30, 1, 30, 1))
semPaths(ch05a.fit, 'std', mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, 'std', mar = c(30, 1, 30, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\Ch05.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05.model<-'
#define the measurement model
FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
#define CFA
ch05a.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = FALSE)
ch05b.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = TRUE)
inspect(ch05a.fit)
inspect(ch05b.fit)
summary(ch05a.fit, fit.measures=TRUE, standard=TRUE)
summary(ch05b.fit, fit.measures=TRUE, standard=TRUE)
modificationIndices(ch05a.fit)
library(semPlot)
semPaths(ch05a.fit, mar = c(30, 1, 30, 1))
semPaths(ch05a.fit, 'std', mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, 'std', mar = c(30, 1, 30, 1))
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\Ch05.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05.model<-'
FA=~NA*A1+A2+A3
FB=~NA*B1+B2+B3
FC=~NA*C1+C2+C3
FD=~NA*D1+D2+D3
FE=~NA*E1+E2+E3
FF=~NA*F1+F2+F3
FA~~1*FA
FB~~1*FB
FC~~1*FC
FD~~1*FD
FE~~1*FE
FF~~1*FF'
ch05.fit <- cfa(model=ch05.model, sample.cov=ch05.cov, sample.nobs=313)
inspect(ch05.fit)
summary(ch05.fit, fit.measures=TRUE, standard=TRUE)
parameterEstimates(ch05.fit, standardized = TRUE)
fitted(ch05.fit)
modificationIndices(ch05.fit)
#Chapter 5: Confirmatory Factor Analysis using raw data
library(lavaan)
ch05.rawdata<-read.csv("c:\\SEM\\Ch05\\R\\Ch05.csv", header=TRUE)
ch05.cov<-cov(ch05.rawdata)
ch05.model<-'
#define the measurement model
FA =~ L11*A1 + L21*A2 + L31*A3
FB =~ L12*B1 + L22*B2 + L32*B3
FC =~ L13*C1 + L23*C2 + L33*C3
FD =~ L14*D1 + L24*D2 + L34*D3
FE =~ L15*E1 + L25*E2 + L35*E3
FF =~ L16*F1 + L26*F2 + L36*F3'
#define CFA
ch05a.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = FALSE)
ch05b.fit<-cfa(model=ch05.model,sample.cov=ch05.cov,sample.nobs=313,
orthogonal = TRUE)
inspect(ch05a.fit)
inspect(ch05b.fit)
summary(ch05a.fit, fit.measures=TRUE, standard=TRUE)
summary(ch05b.fit, fit.measures=TRUE, standard=TRUE)
modificationIndices(ch05a.fit)
library(semPlot)
semPaths(ch05a.fit, mar = c(30, 1, 30, 1))
semPaths(ch05a.fit, 'std', mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, mar = c(30, 1, 30, 1))
semPaths(ch05b.fit, 'std', mar = c(30, 1, 30, 1))
