# Using built-in dataset
data(acrylic)
ans <- sgSEMp2(acrylic)
ans$res.print
plot(ans)
## Not run:
# # Using simulated data
# x4=runif(100,0,2)
# x3=1+2.5*x4+rnorm(100,0,0.5)
# x1=runif(100,1,4)
# x2=-1-x1+x3+rnorm(100,0,0.3)
# y=2+2*exp(x1/3)+(x2-1)^2-x3+rnorm(100,0,0.5)
# # Check the pairwise plot
# sim=cbind(x4,y,x1,x2,x3)
# pairs(sim)
# ans <- sgSEMp2(as.data.frame(sim))
# plot(ans)
# ## End(Not run)
Run the code above in your browser using DataLab