4
$\begingroup$

This is a mediation model with a categorical exogenous variable. I am trying to compare the results by running SEM and regression. The third step regression was conducted and I found the estimates were the same, but the standard errors were different. Any idea? Thanks for your help.

library(rms)

library(lavaan)


y <- seq(1:10)
m <- c(1,4,5,3,6,3,5,7,4,9)
race <- c(1,3,2,1,2,3,3,2,2,2)
data <- data.frame(cbind(y, m, race))
A <- as.data.frame(model.matrix( y~ m*factor(race), data = data))
data$rd2 <- A[,3]
data$rd3 <- A[,4]
data$inter2 <- A[,5]
data$inter3 <- A[,6]
ols(y~m+rd2+rd3+inter2+inter3, data=data)
model <- 'm~rd2+rd3
y~m+rd2+rd3+inter2+inter3
m~~0*y'
fit<-sem(model, data=data)
summary(fit)
$\endgroup$
  • $\begingroup$ Why do you set the residual covariance between m any to zero (m~~0*y)? This is basic model assumption that would be made anyhow. Therefore, I assume this is not what you actually intended to do. $\endgroup$ – StoryTeller0815 Aug 3 at 6:22
0
$\begingroup$

Typically, standard errors need to account for multi-stage procedures. It is the same for two-stage least squares; standard errors in the second stage do not adequately account for the sampling noise introduced by the fact that you have a "generated regressor", which also has sampling noise in it. Thus, multi-step procedures tend to have too low standard errors.

$\endgroup$
  • $\begingroup$ Thanks, Superpronker. If I understand correctly, the standard errors from the ols are more trustworthy? $\endgroup$ – Andrew Dec 13 '16 at 21:35
  • $\begingroup$ Other way around, OLS standard errors do not account for the two step nature of the problem. $\endgroup$ – Superpronker Dec 14 '16 at 4:56
  • $\begingroup$ But when you take a look at the standard errors, it's the OLS regression that shows inflated standard errors... Isn't multicollinearity a better explanation? Some of the variables are extremely correlated. $\endgroup$ – StoryTeller0815 Aug 3 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.