data(industry)
# estimation without control options
mycode <- list(
Consum~quec(Job,0,6),
Pollution~quec(Job,1,11)+quec(Consum,1,6)
)
myfit <- dlsem(mycode,group="Region",exogenous=c("Population","GDP"),
data=industry,uniroot.check=TRUE,log=TRUE)
### adaptation of lag shapes (may take some seconds more)
## model code
#mycode <- list(
# Consum~quec(Job,0,15),
# Pollution~quec(Job,0,15)+quec(Consum,0,15)
# )
#
#mycontrol <- list(
# adapt=c(Consum=T,Pollution=T),
# max.gestation=list(Consum=c(Job=3),Pollution=c(Consum=3,Job=3)),
# min.width=list(Consum=c(Job=5),Pollution=c(Consum=5,Job=5)),
# max.width=list(Consum=c(Job=15),Pollution=c(Consum=15,Job=15)),
# sign=list(Consum=c(Job="+"),Pollution=c(Consum="+",Job="+"))
# )
#myfit <- dlsem(mycode,group="Region",exogenous=c("Population","GDP"),data=industry,
# control=mycontrol,uniroot.check=TRUE,log=TRUE)
# summaries of estimation
summary(myfit)
# display the directed acyclic graph
plot(myfit)
Run the code above in your browser using DataLab