Page 1 of 1

Scalar Conundrum

Posted: Wed Apr 07, 2010 2:26 pm
by einsler
I was wondering if anyone could help me and some of my classmates. We are using E-Views 6.

we have input the following code:

Code: Select all

!zhat=c(1)+c(2)*@mean(trated)+c(3)*@mean(tspeedd) !prob=@cnorm(!zhat)
It returned the error: "!ZHAT is not defined"

With our understanding of E-Views, we have no idea why we are getting this error, because we feel that the scalar ZHAT is properly defined. We are also sure that all of our series are genred properly and we all got the same regression coefficients for c(1), c(2), and c(3).

Any help you could provide us would be highly appreciated.

Re: Scalar Conundrum

Posted: Wed Apr 07, 2010 2:39 pm
by EViews Gareth
At a guess, one of those series doesn't exist. As an example, the following code seems to work:

Code: Select all

create u 100 series trated = rnd series tspeedd = rnd !zhat=c(1)+c(2)*@mean(trated)+c(3)*@mean(tspeedd) scalar p = !zhat

Re: Scalar Conundrum

Posted: Wed Apr 07, 2010 2:51 pm
by EViews Glenn
One thing to note, the original example will only work if the commands are executed from a program file. Otherwise, you'll get the original reported error message. If you wish to continue working interactively, you should use scalar objects instead of replacement variables as in

Code: Select all

scalar zhat=c(1)+c(2)*@mean(trated)+c(3)*@mean(tspeedd) scalar prob=@cnorm(zhat)

Re: Scalar Conundrum

Posted: Wed Apr 07, 2010 2:52 pm
by EViews Gareth
Good call Glenn.