Problem with little program for Data Manipulation

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

Nova25
Posts: 2
Joined: Wed Aug 24, 2011 10:11 pm

Problem with little program for Data Manipulation

Postby Nova25 » Wed Dec 28, 2011 5:07 am

Hello, i'm using EViews 7.2.

I need help with a little program.

series test=na

!q=1

' for !q = 1 to 5 'loop for all 5 weekdays (deactivated)
for !i = 9 to 18 'loop limits hours
smpl @all if weekdy=!q and @hour >= !i and @hour <!i+1
test = @mean(rt*rt)
next
' next

This program does exactly what i would need, but i need it in half-hour steps and not hourly.

Could someone help me please?

Program and Data Files are attached!

Greetings, Nova
Attachments
msci_europe_5m.wf1
(433.37 KiB) Downloaded 160 times
test1.prg
(216 Bytes) Downloaded 204 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem with little program for Data Manipulation

Postby EViews Gareth » Wed Dec 28, 2011 8:41 am

Probably the easiest thing to do is to just add two case inside your loop. One for @minute<30 and one for @minute>=30.

Nova25
Posts: 2
Joined: Wed Aug 24, 2011 10:11 pm

Re: Problem with little program for Data Manipulation

Postby Nova25 » Thu Dec 29, 2011 11:33 pm

Thank you Gareth!

I tried this before too, but i wasn't able to implement it right.
The problem still exists, because i don't really know how i should bring the @minute in the loop.

Maybe you could help me another time?
I know it may be really easy, but atm i'm not able to solve this little problem. :(

Greetings, Nova

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem with little program for Data Manipulation

Postby EViews Gareth » Fri Dec 30, 2011 10:05 am

Something like:

Code: Select all

series test=na !q=1 ' for !q = 1 to 5 'loop for all 5 weekdays (deactivated) for !i = 9 to 18 'loop limits hours smpl @all if weekdy=!q and @hour >= !i and @hour <!i+1 and @minute<30 test = @mean(rt*rt) smpl @all if weekdy=!q and @hour >= !i and @hour <!i+1 and @minute>=30 test = @mean(rt*rt) next ' next


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests