Search found 256 matches

by EViews Matt
Wed Jul 11, 2018 10:05 am
Forum: Programming
Topic: Scalar of average of last 12 months
Replies: 2
Views: 46

Re: Scalar of average of last 12 months

Hello,

Something along this line should work,

Code: Select all

%tmp = @datestr(@dateadd(@dateval(data.@last), -11, "MM")) + " " + data.@last
smpl %tmp
scalar test = @mean(data)
smpl @all
by EViews Matt
Mon Jul 02, 2018 10:11 am
Forum: Programming
Topic: @recode
Replies: 22
Views: 1847

Re: @recode

I believe part of the issue is that you're attempting to access objects in two different workfiles. It'll be easier to write your program if all the data is in single workfile. My advise would be to copy the AG workfile page to the CUSIP_FF_run workfile (as a new page, and renaming it to AG). You ca...
by EViews Matt
Fri Jun 29, 2018 10:18 am
Forum: Programming
Topic: Loop to run equation
Replies: 10
Views: 227

Re: Loop to run equation

The formula in your Excel file is missing the parentheses around the denominator.
by EViews Matt
Fri Jun 29, 2018 10:00 am
Forum: Programming
Topic: Combine Matrix
Replies: 4
Views: 1020

Re: Combine Matrix

Hello,

Let's take a step back here. EViews can import your data into a monthly workfile. The trick is to indicate that the first column of data should be imported as characters, not a number. You'll then have the option to use that series as the date series for the workfile.
by EViews Matt
Fri Jun 29, 2018 9:27 am
Forum: Data Manipulation
Topic: how to transform a matrix into group
Replies: 4
Views: 906

Re: how to transform a matrix into group

The spaces mentioned are the spaces between the function name and its parenthesized arguments, i.e., "mtos (a,g1)" should be "mtos(a,g1)".

Groups don't support header lines, but you could create a table from the group and add the header line to the table.
by EViews Matt
Thu Jun 28, 2018 9:11 am
Forum: General Information and Tips and Tricks
Topic: NA versus zero values
Replies: 4
Views: 166

Re: NA versus zero values

Yes, this seems like a sample issue. Does the following sequence result in NAs in SERIES3?

Code: Select all

smpl @all if SERIES1 = na
SERIES1 = 0
smpl @all
SERIES3 = SERIES1 + SERIES2
by EViews Matt
Thu Jun 28, 2018 9:03 am
Forum: Programming
Topic: @recode
Replies: 22
Views: 1847

Re: @recode

When you're on the topic list page for a board, just press the "New Topic" button. This button is located near both the top (shown below) and bottom of the page.

post.png
post.png (39.5 KiB) Viewed 89 times
by EViews Matt
Wed Jun 27, 2018 1:36 pm
Forum: Programming
Topic: Loop to run equation
Replies: 10
Views: 227

Re: Loop to run equation

I don't know what calculations you performed in Excel, so I can't say why you're getting different results in EViews. Chances are that either the Excel formula or the EViews formula is not calculating what you think it is.
by EViews Matt
Wed Jun 27, 2018 1:01 pm
Forum: Programming
Topic: @recode
Replies: 22
Views: 1847

Re: @recode

Here's an example that gets you part way there. I'd forgotten that EViews will prepend "num" to numeric series names during an import, but that's easy to work around. wfopen CUSIP_FF_run.xlsx range=CUSIP_FF colhead=1 na="#N/A" @smpl @all wfopen Dret_Mret_test.xlsx range=ACT1_RET_...
by EViews Matt
Wed Jun 27, 2018 10:04 am
Forum: Programming
Topic: @recode
Replies: 22
Views: 1847

Re: @recode

I understand now, you want to eliminate columns (series), not observations. Once you've imported both files, you can go through each series name of the second file (using @wlookup) and see whether it is present in DS_S_F (similar to the code several posts ago) within the first file. If not, then del...
by EViews Matt
Wed Jun 27, 2018 9:17 am
Forum: Programming
Topic: @recode
Replies: 22
Views: 1847

Re: @recode

It's unclear to me which observations you want to keep. Regardless, if you can create a dummy series indicating which observations you want to keep, you can then contract the workfile page using that series and save it as a new workfile.
by EViews Matt
Wed Jun 27, 2018 9:03 am
Forum: Programming
Topic: Loop to run equation
Replies: 10
Views: 227

Re: Loop to run equation

Very odd. Anyway, the regular (non-pool) genr command can calculate a series backwards, so a combination of your initial code and a loop over the crossids in the pool should do the trick. For example, %tmp = aapool_reits.@crossids for %cid {%tmp} smpl @now-1 @now-1 genr(r) idxpricereal{%cid}=100 smp...
by EViews Matt
Tue Jun 26, 2018 4:58 pm
Forum: Programming
Topic: Loop to run equation
Replies: 10
Views: 227

Re: Loop to run equation

Curious. Perhaps the issue is that an expression such as @now-1 or @now-4 behaves differently as part of a smpl command than it does as part of a general expression. In a smpl command, the -1 or -4 are in units of your workfile's frequency, e.g., years. However, in a general expression the units mat...
by EViews Matt
Tue Jun 26, 2018 9:51 am
Forum: Programming
Topic: Loop to run equation
Replies: 10
Views: 227

Re: Loop to run equation

Hello, Mathematically, your idxprice is just a scaled version of price . There's no need to explicitly evaluate that equation backwards through your observations, just scale the data so that the target observation has a value of 100. For example, %tmp = @datestr(@now) aapool_reits.genr idxprice? = p...
by EViews Matt
Tue Jun 26, 2018 8:58 am
Forum: Suggestions and Requests
Topic: Zero disappears with round
Replies: 2
Views: 77

Re: Zero disappears with round

Hello,

You can use the optional second argument to @str to specify a format for the resulting string, including how may digits should appear to the right of the decimal point. I believe what you're asking for is accomplished with @str(!j, "f.1").

Go to advanced search