 Hello,

I have just started to work on a path analysis (see attached image for the
diagram), but I have encountered an error message.




This is the code I have used:

cov_matrix<-var(xdata)

library(sem)
model.xdata<-specifyModel()
x1 -> y2, xy12, NA
x2 -> y1, xy21, NA
y1 -> y2, yy12, NA
y2 -> y3, yy23, NA
y2 -> y4, yy24, NA
y3 -> y4, yy34, NA
y2 <-> y2, y2error, NA
y1 <-> y1, y1error, NA
y3 <-> y3, y3error, NA
y4 <-> y4, y4error, NA

model.xdata.sem <- sem(model.xdata, cov_matrix, nrow(xdata))

and the error message is:
Error in csem(model = model.description, start, opt.flag = 1, typsize =
typsize,  :
  The matrix is non-invertable.

I fear to have a problem in the data.
I would be very grateful if you could help me to solve this problem and
proceed with my analyses.

thank you in advance for your help!
Sarah

	[[alternative HTML version deleted]]

