Max

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

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Max

Postby basil » Mon May 09, 2011 8:26 am

Hi there, this is probably a very simple question- what is the right syntax for the following arguments:

(1) vector(3) xxx=(1 2 3)
(2) scalar a=@max(1 2)

Thanks
Basile

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

Re: Max

Postby EViews Gareth » Mon May 09, 2011 8:39 am

I don't understand the question.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Max

Postby basil » Mon May 09, 2011 9:06 am

(1) I am trying to declare a vector and assign values, but the syntax "vector(3) xxx=(1 2 3)" generates an error. What is wrong with it?
(2) I am trying to apply to the max function on two scalars ("s1" and "s2"), but the syntax "a=@max(s1 s2)" generates an error. What is wrong with it?

Any suggestions? Thanks.

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

Re: Max

Postby EViews Gareth » Mon May 09, 2011 9:16 am

1). I'm not sure where you got that syntax from, but it is not EViews syntax.

Code: Select all

vector(3) xxx xxx.fill 1,2,3
2) Same as above.

Code: Select all

scalar a = @recode(s1>s2, s1, s2)

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Max

Postby basil » Mon May 09, 2011 9:39 am

Thanks, this is helpful.

(1) As for one, since the following works "vector(3) xxx=x" (where x is a predefined vector or scalar), I thought there is a way to use "1 2 3" instead of x. It looks like I was wrong.

(2) Your proposed solution works. So it looks like @max works only on a predefined matrix and vectors but does not work with scalars.

May I ask one more quick question:
(3) is there a way to delete a specific row (or column) from a matrix? Assume x is 10x5 matrix and I would like to delete the rows (or columns) 3-4? What if want to delete the first 2 rows?

Much appreciated.

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

Re: Max

Postby EViews Gareth » Mon May 09, 2011 9:46 am

You'll have to use the extract functions (@rowextract, @colextract, @subextract) to take the pieces you want into new matrices. There is no delete function for matrices.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Max

Postby basil » Mon May 09, 2011 11:03 am

thx v m.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests