Write Command
Posted: Mon Jan 27, 2025 3:15 am
Hello,
How can I write a list of variables to just one file with a loop please?
The write command below only saves the last variable, e.g. with "JPY" mentioned in it. Ideally, I would like to have all the variables in one file.
Is there also a way to save it into an existing Excel .xlsx file directly into a certain workbook?
Thanks a lot.
Best wishes,
Günter
for %i EUR CHF GBP JPY
' PPP CPI
' Engle-Granger Cointegration Test
group G_USD_{%i}_PPP log({%i}) log(uspric1001) log({%i}_CPI)
show G_USD_{%i}_PPP
g_USD_{%i}_ppp.coint(method=eg)
equation eq_usd_{%i}_ppp_cpi.ls log({%i}) log(uspric1001) log({%i}_CPI)
eq_usd_{%i}_ppp_cpi.forecast(forcsmpl="1975m01 2025m01") USD_{%i}_PPP_CPI_Fit
write(t=txt,na=,dates) S:\Eviews\Scorecard\Eviews_Series\USD_{%i}_PPP_CPI_Fit.csv USD_{%i}_PPP_CPI_Fit
next
How can I write a list of variables to just one file with a loop please?
The write command below only saves the last variable, e.g. with "JPY" mentioned in it. Ideally, I would like to have all the variables in one file.
Is there also a way to save it into an existing Excel .xlsx file directly into a certain workbook?
Thanks a lot.
Best wishes,
Günter
for %i EUR CHF GBP JPY
' PPP CPI
' Engle-Granger Cointegration Test
group G_USD_{%i}_PPP log({%i}) log(uspric1001) log({%i}_CPI)
show G_USD_{%i}_PPP
g_USD_{%i}_ppp.coint(method=eg)
equation eq_usd_{%i}_ppp_cpi.ls log({%i}) log(uspric1001) log({%i}_CPI)
eq_usd_{%i}_ppp_cpi.forecast(forcsmpl="1975m01 2025m01") USD_{%i}_PPP_CPI_Fit
write(t=txt,na=,dates) S:\Eviews\Scorecard\Eviews_Series\USD_{%i}_PPP_CPI_Fit.csv USD_{%i}_PPP_CPI_Fit
next