Thank you and happy Friday 13th
Transpose
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Transpose
Also wondering how I would delete all series that have ONLY #N/A's in them. I found some posts about deleting series' with #N/A but this applies to series' with any #N/As
Thank you and happy Friday 13th
Thank you and happy Friday 13th
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Transpose
I don't understand this question.Hi Glen and Gareth,
I am working on a program and am trying to figure out how to specify a loop command for a particular worksheet in Eviews.
I load in 2 excel worksheets from the same workbook which become separate Eviews tabs. Howver, when I try to execute a loop it does it to both tabs in the EViews workfile!
Many thanks
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Transpose
You can use series.@obs to return the number of non NA values in a series.Also wondering how I would delete all series that have ONLY #N/A's in them. I found some posts about deleting series' with #N/A but this applies to series' with any #N/As
Thank you and happy Friday 13th
Re: Transpose
Below is the code I use. When I run the series avg_{%h}_bs_{%i} command below it also tries to do this for the second tab (resulting in an error) where it obviously can't find the _bs_ as they are only on the first page.
wfcreate(wf=semi-annual) s 1990 2017
%mypath = @runpath
cd %mypath
'loads first sheet of Excel file where BS data is
pageload(page="Stoxx600_BS") Stoxx600_dataS.xlsx byrow range="EViews1" @freq s 1990s1
pageload(page="Stoxx600_IS") Stoxx600_dataS.xlsx byrow range="EViews2" @freq s 1990s1
'creates average of all variables by dividing totals by number of observations
for %h Cons_Disc Cons_Stap Energy Fin Health Indust IT Mat Telecom Utilities Tot Tot_xFin Tot_xEn Tot_xFE
for %i cash acctrcv invent netfxda totasst LTdebt totliab retearn toteq totlns llrsrv dmddepo STbrrw
series avg_{%h}_bs_{%i} = {%h}_bs_{%i} /{%h}_bs_obs{%i}
next
next
wfcreate(wf=semi-annual) s 1990 2017
%mypath = @runpath
cd %mypath
'loads first sheet of Excel file where BS data is
pageload(page="Stoxx600_BS") Stoxx600_dataS.xlsx byrow range="EViews1" @freq s 1990s1
pageload(page="Stoxx600_IS") Stoxx600_dataS.xlsx byrow range="EViews2" @freq s 1990s1
'creates average of all variables by dividing totals by number of observations
for %h Cons_Disc Cons_Stap Energy Fin Health Indust IT Mat Telecom Utilities Tot Tot_xFin Tot_xEn Tot_xFE
for %i cash acctrcv invent netfxda totasst LTdebt totliab retearn toteq totlns llrsrv dmddepo STbrrw
series avg_{%h}_bs_{%i} = {%h}_bs_{%i} /{%h}_bs_obs{%i}
next
next
Re: Transpose
I found this on a previous answer you provided. Does this delete objects with ONLY #N/As.
group g*
for !i=1 to g.@count
%name = g.@seriesname(!i)
if @obs({%name}) = 0 then
d {%name}
endif
next
group g*
for !i=1 to g.@count
%name = g.@seriesname(!i)
if @obs({%name}) = 0 then
d {%name}
endif
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Transpose
You've explicitly told EViews to load/create a 2nd page. Everything you do after creating that 2nd page will only apply to that page.Below is the code I use. When I run the series avg_{%h}_bs_{%i} command below it also tries to do this for the second tab (resulting in an error) where it obviously can't find the _bs_ as they are only on the first page.
wfcreate(wf=semi-annual) s 1990 2017
%mypath = @runpath
cd %mypath
'loads first sheet of Excel file where BS data is
pageload(page="Stoxx600_BS") Stoxx600_dataS.xlsx byrow range="EViews1" @freq s 1990s1
pageload(page="Stoxx600_IS") Stoxx600_dataS.xlsx byrow range="EViews2" @freq s 1990s1
'creates average of all variables by dividing totals by number of observations
for %h Cons_Disc Cons_Stap Energy Fin Health Indust IT Mat Telecom Utilities Tot Tot_xFin Tot_xEn Tot_xFE
for %i cash acctrcv invent netfxda totasst LTdebt totliab retearn toteq totlns llrsrv dmddepo STbrrw
series avg_{%h}_bs_{%i} = {%h}_bs_{%i} /{%h}_bs_obs{%i}
next
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Transpose
There's an easy way to find out.I found this on a previous answer you provided. Does this delete objects with ONLY #N/As.
group g*
for !i=1 to g.@count
%name = g.@seriesname(!i)
if @obs({%name}) = 0 then
d {%name}
endif
next
Who is online
Users browsing this forum: No registered users and 2 guests
