Scalar Conundrum

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

einsler
Posts: 6
Joined: Fri Feb 19, 2010 1:20 pm

Scalar Conundrum

Postby einsler » Wed Apr 07, 2010 2:26 pm

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.

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

Re: Scalar Conundrum

Postby EViews Gareth » Wed Apr 07, 2010 2:39 pm

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

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Scalar Conundrum

Postby EViews Glenn » Wed Apr 07, 2010 2:51 pm

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)

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

Re: Scalar Conundrum

Postby EViews Gareth » Wed Apr 07, 2010 2:52 pm

Good call Glenn.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests