Code: Select all
calendar(q) 1947 1
allocate 50 2015:2
smpl 1950:1 2000:1
open data nipa.csv
data(format=cdf, org=columns, dateform="m/d/y") 1947:1 2015:2 gdp cons gce gov unemp
close data
* compute logs
dofor s = gdp cons gce gov unemp
compute [label] lbl = "l" + %l(s)
set %s(lbl) = log(s{0})
compute [label] dlbl = "dl" + %l(s)
set %s(dlbl) = log(s{0}) - log(s{1})
end dofor s
/****
dofor s = gdp cons gce gov
compute [label] lbl_ = %l(s) + "_"
set %s(lbl_) = %na
end dofor s
****/
declare string model
dofor model = "a" "b"
dofor s = gdp cons gce gov
compute [label] lbl_ = %l(s) + "_"
if model == "a" {
compute [label] s_lbl = "L" + %l(s)
}
else if model == "b" {
compute [label] s_lbl = "DL" + %l(s)
}
set %s(lbl_) = %s(s_lbl)
labels %s(lbl_)
# s_lbl
end dofor s
dofor s = gdp_ cons_ gce_ gov_
linreg s
# unemp{1 to 4}
end dofor s
end dofor model
Code: Select all
(01.0389) dofor s = gdp_ <<<<
## SX11. Identifier GDP_ is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>Is it possible you meant
GDP
LGDP
If the name isn't mistyped, it's possible that you have a poorly formatted instruction
Common errors are
* a space before the ( in an option field
* a missing space before = in a SET or FRML
* a missing $ at the end of a long line which continues to the next
cons_ gce_ gov_
Code: Select all
dofor s = gdp cons gce gov
compute [label] lbl_ = %l(s) + "_"
set %s(lbl_) = %na
end dofor s
EDIT:
Furthermore, I actually tried simply declaring the series
Code: Select all
dofor s = gdp cons gce gov
compute [label] lbl_ = %l(s) + "_"
declare series %s(lbl_)
end dofor s
Code: Select all
(01.0113) declare series %s(## SX1. Identifier %S is Already in use as a(n) FUNCTION