R Community -

I'm trying to build the model in the image below, but having troubles
correctly specifying the syntax:

library(lavaan)

library(semPlot)

lower <- matrix(c(1, 0, 0, 0, .475, 1, 0, 0, .738, .643, 1, 0, .608, .721,
.823, 1), 4, 4, byrow = TRUE)


colnames(lower) <- rownames(lower) <- c("constiuentAttitudes",
"congressmanAttitudes", "congressmenPerceptConstiuentAttitudes",
"rollCallBehav")


mod1 <- '

# latent vars

constiuentAttitudes =~ congressmenPerceptConstiuentAttitudes


# regressions



congressmanAttitudes ~ congressmenPerceptConstiuentAttitudes

rollCallBehav ~ congressmenPerceptConstiuentAttitudes + congressmanAttitudes


# error

congressmanAttitudes ~~ congressmenPerceptConstiuentAttitudes

congressmenPerceptConstiuentAttitudes ~~ constiuentAttitudes

rollCallBehav ~~ congressmenPerceptConstiuentAttitudes

rollCallBehav ~~ congressmanAttitudes

'


mod1fit <- sem(mod1, sample.cov = lower, sample.nobs = 116)


semPaths(mod1fit, what = "est", layout = "tree", title = TRUE, style ="LISREL"
, nCharNodes = 10)







-- 

*Edward H Patzelt | Clinical Science PhD StudentPsychology | Harvard
University *

	[[alternative HTML version deleted]]

