Page 1 of 1

Problem with little program for Data Manipulation

Posted: Wed Dec 28, 2011 5:07 am
by Nova25
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

Re: Problem with little program for Data Manipulation

Posted: Wed Dec 28, 2011 8:41 am
by EViews Gareth
Probably the easiest thing to do is to just add two case inside your loop. One for @minute<30 and one for @minute>=30.

Re: Problem with little program for Data Manipulation

Posted: Thu Dec 29, 2011 11:33 pm
by Nova25
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

Re: Problem with little program for Data Manipulation

Posted: Fri Dec 30, 2011 10:05 am
by EViews Gareth
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