Hello,
I am trying to create a series ORDERQ (order_quantity) for which the values in time (sample 2012:01 to 2012:12) are conditional to the values of two other series BEGINQ (beginning_volume_on_stock) and SALES (estimated_sales_volume). For each period in the sample if SALES is lower than BEGINQ the given value of ORDERQ should be zero, else it should give SALES-BEGINQ.
I tried several IF THEN ELSE commands but somehow it didn't give me the right results.
Can someone advise?
Martijn
Program series with minimal values
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Program series with minimal values
Code: Select all
group g beginq sales
series orderq = @rmin(g)
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Program series with minimal values
Shouldn't it beCode: Select all
group g beginq sales series orderq = @rmin(g)
Code: Select all
series orderq = @recode(sales<beginq,0,sales-beginq)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Program series with minimal values
Yes, I misread.
Re: Program series with minimal values
Dear startz and eviews gareth,
Thank you for the reply.
Reviewing both options:
The @RMIN option may not work as I guess it return minus values where it should put zeros.
I tried the @Recode command but I get message "recode is not a genr or expression function" (by the way I get a similar message when I enter the @RMIN command). Maybe this is because I am using a old version of Eviews (2.0).
Furthermore I am not sure whether the recode command works as the beginning stock balances depend on the order and sales quantity one period back. So I need a dynamic calculation. How could I best do this?
Thank you for the reply.
Reviewing both options:
The @RMIN option may not work as I guess it return minus values where it should put zeros.
I tried the @Recode command but I get message "recode is not a genr or expression function" (by the way I get a similar message when I enter the @RMIN command). Maybe this is because I am using a old version of Eviews (2.0).
Furthermore I am not sure whether the recode command works as the beginning stock balances depend on the order and sales quantity one period back. So I need a dynamic calculation. How could I best do this?
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Program series with minimal values
I think EViews 2 is nearly 20 years out of date. You may find what you can do is limited. Having said that, if you want to reference the lagged value of X, write X(-1). You may be able to substitute for the @recode function
Code: Select all
series orderq = (sales<beginq)*0 + (1-(sales<beginq))*(sales-beginq)Re: Program series with minimal values
Dear startz,
This formula works.
Thank you for your help!
This formula works.
Thank you for your help!
Who is online
Users browsing this forum: No registered users and 2 guests
