data(agres)
# model code
mycode <- list(
GVA~quec(NPATENT,0,4),
PPI~quec(NPATENT,0,6)+quec(GVA,0,10),
ENTR_INCOME~quec(NPATENT,0,3)+quec(GVA,1,10)
)
# control options
mycontrol <- list(
adapt=c(GVA=TRUE,PPI=TRUE,ENTR_INCOME=TRUE),
max.gestation=list(GVA=c(NPATENT=3),PPI=c(NPATENT=3,GVA=3),ENTR_INCOME=c(NPATENT=3,GVA=3)),
min.width=list(GVA=c(NPATENT=3),PPI=c(NPATENT=3,GVA=3),ENTR_INCOME=c(NPATENT=3,GVA=3)),
sign=list(GVA=c(NPATENT="+"),PPI=c(NPATENT="-",GVA="-"),ENTR_INCOME=c(NPATENT="+",GVA="+"))
)
# fitting without control options
mod0 <- dlsem(mycode,group="COUNTRY",context=c("GDP","FARM_SIZE"),data=agres,
uniroot.check=TRUE,maxdiff=1,imputation=FALSE,log=TRUE)
### AIC-based selection of lag shapes: not RUN
#mod0 <- dlsem(mycode,group="COUNTRY",context=c("GDP","FARM_SIZE"),data=agres,
# control=mycontrol,uniroot.check=TRUE,maxdiff=1,imputation=FALSE,log=TRUE)
# summaries of model fitting
summary(mod0)
# the directed acyclic graph of the structural model
plot(mod0)
Run the code above in your browser using DataLab