Hello,
I am running two different regression models. The first runs fine, but the second returns the Mx Status Red error. The Model 2 script is the same as Model 1, just with different data. Any help would be appreciated.
Thanks,
Jeff
begin script
> ###########
> # Model 1 #
> ###########
>
>
> R.smp1 <- matrix(c(1.0000000, 0.7534779, 0.3378677,
+ 0.7534779, 1.0000000, 0.3757937,
+ 0.3378677, 0.3757937, 1.0000000),3,3)
>
> pred <- c("x1","x2"); out <- "y"
> varnames <- c(pred,out)
> dimnames(R.smp1) <- list(varnames,varnames)
>
> n1 <- 50 # sample size
>
> m1 <- mxModel("Regression of y on X (standardized)",
+ type="RAM",
+ manifestVars=varnames,
+
+ mxPath(from=pred,to=out,
+ arrows=1,
+ free=TRUE,values=.3,
+ labels=c("b1","b2")),
+
+ mxPath(from=out,arrows=2,
+ free=TRUE,values=.8,
+ labels=c("VarE")),
+
+ mxPath(from=pred,to=pred,arrows=2,
+ all=TRUE,free=TRUE,
+ values=.2),
+
+ mxPath(from=pred, arrows=2,
+ free=TRUE, values=1),
+
+ mxCI(c("b1","b2")),
+
+ mxData(observed=R.smp1,type="cov",numObs=n1))
>
> m1.run <- mxRun(m1,intervals=TRUE)
Running Regression of y on X (standardized)
>
>
> ###########
> # Model 2 #
> ###########
>
>
> R.smp2 <- matrix(c(1.00000000, 0.97364484, -0.26357364,
+ 0.97364484, 1.00000000, -0.06512353,
+ -0.26357364, -0.06512353, 1.00000000),3,3)
> dimnames(R.smp2) <- list(varnames,varnames)
>
> n2 <- 100
>
> m2 <- mxModel("Regression of y on X (standardized)",
+ type="RAM",
+ manifestVars=varnames,
+
+ mxPath(from=pred,to=out,
+ arrows=1,
+ free=TRUE,values=.3,
+ labels=c("b1","b2")),
+
+ mxPath(from=out,arrows=2,
+ free=TRUE,values=.8,
+ labels=c("VarE")),
+
+ mxPath(from=pred,to=pred,arrows=2,
+ all=TRUE,free=TRUE,
+ values=.2),
+
+ mxPath(from=pred, arrows=2,
+ free=TRUE, values=1),
+
+ mxCI(c("b1","b2")),
+
+ mxData(observed=R.smp2,type="cov",numObs=n2))
>
> m2.run <- mxRun(m2,intervals=TRUE)
Running Regression of y on X (standardized)
Warning message:
In model 'Regression of y on X (standardized)' NPSOL returned a non-zero status code 6. The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED)