Code: Select all
calendar(q) 1947 1
compute t0 = 1970:1
compute tT = 2002:4
open data "data.csv"
data(format = cdf, org = columns) /
close data
smpl t0 tT
declare string model_name
dofor model_name = "level" "diff"
if model_name == "level" {
system(model = full_model)
variables lgdpk lcdk
lags 1 to 4
deterministic fcm10c{1 to 4} constant
end(system)
}
else {
system(model = full_model)
variables dlgdpk dlcdk
lags 1 to 4
deterministic fcm10c{1 to 4} constant
end(system)
}
dofor dep_var = %modeldepvars(full_model)
compute eq = %modelfind(full_model, dep_var)
compute d = model_name + " " + %l(dep_var) + " maps to " + %l(%eqndepvar(eq)) + " with eq # " + eq
display d
end dofor dep_var
end dofor model_name
Code: Select all
level LGDPK maps to LGDPK with eq # 1
level LCDK maps to LCDK with eq # 2
diff DLGDPK maps to LGDPK with eq # 1
diff DLCDK maps to LCDK with eq # 2
If I swap "level" and "diff" in the declaration of the outer loop, the output is reversed:
Code: Select all
diff DLGDPK maps to DLGDPK with eq # 1
diff DLCDK maps to DLCDK with eq # 2
level LGDPK maps to DLGDPK with eq # 1
level LCDK maps to DLCDK with eq # 2