How to copy values of formulas?

For questions regarding programming in the EViews programming language.

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

BigUnit
Posts: 4
Joined: Thu Oct 02, 2008 2:16 pm

How to copy values of formulas?

Postby BigUnit » Tue Oct 28, 2008 7:15 am

How do I copy only the values of formulas from one page to another.

i.e.

pageselect page1
frml xxx = yyy

pageselect page2
copy(o) page1\xxx page2\

Note that if page2 doesn't have "yyy" then the copy command returns NA.

Is there an option that allows me to copy the formula's values from page1 so that it becomes a series in page2?

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

Re: How to copy values of formulas?

Postby EViews Gareth » Tue Oct 28, 2008 7:38 am

You'll have to make a series on the first page, then copy that over.

Code: Select all

pageselect page1 frml xxx=yyy series xxxx=xxx copy page1\xxxx page2\xxx

BigUnit
Posts: 4
Joined: Thu Oct 02, 2008 2:16 pm

Re: How to copy values of formulas?

Postby BigUnit » Tue Oct 28, 2008 8:13 am

You're right, but If I use the "series" command then I may as well leave out the formula altogether and just type

pageselect page1
series xxx = yyy

I want to maintain my auto updating series and retain my frml command.

I could do:

pageselect page1
frml xxx = yyy

pageselect page2
link xxx.linkto page1\xxx
unlink xxx

the problem is that the next time I update this file, I get an error because the link is now a series and as such is of the wrong type. "copy(o)" avoids this problem, but then I'm stuck with the NA issue.

Question: Why is it that if I paste the values of a formula into a new page that I get "NA" instead of the values?

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

Re: How to copy values of formulas?

Postby EViews Gareth » Tue Oct 28, 2008 8:18 am

I'm not sure I follow. If you want to copy values into a new page, then why does it matter whether they come from a frml or a series - you are just copying the values after all.

When you copy a formula from one page to another, you are really just copying the formula, not the numbers calculated by that formula. Thus you will get NAs if that formula now depends upon series that don't exist on the new page.

BigUnit
Posts: 4
Joined: Thu Oct 02, 2008 2:16 pm

Re: How to copy values of formulas?

Postby BigUnit » Tue Oct 28, 2008 9:01 am

the difference is that the series command requires user input whereas the frml command doesn't.

this is useful if we want to automate certain tasks and reduce the number of programs that users need to run.

For instance, I like to separate my data updating process from my data manipulation.
I regularly get the same data and I can assign variable names and perform the basic manipulation I need using the frml command. I keep this data in a separate page in the workfile so it's clean and always readily accessible. Once the formulas are set up, the system is foolproof and anyone can use it and update it by simply pasting the raw data. This cuts down on the number of programs that need to be run and on potential programming errors. - Plus it's very 'clean' and keeps things organized.
I then can have multiple pages where I perform different data manipulations that all reference the data in the original sheet. - And most of the time, the way to do that would be by duplicating the data using the copy(o) command.

Perhaps you can add an option to copy that will actually paste "values" not just the underlying formula. I'm sure others would find that helpful as well.

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

Re: How to copy values of formulas?

Postby EViews Gareth » Tue Oct 28, 2008 9:28 am

I understand that formulas are useful to use rather than series, but if you are copying as values, then there is no benefit in using a frml over a series.

Thus use frmls in your workfile, but whenever you wish to copy, first create a series then copy the series. You can delete that series straight away if you like.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests