data problem

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

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

data problem

Postby rogerioms » Sat Apr 25, 2009 11:19 am

I am trying compute the variance of the difference between two series, x and y, but some of them may have missing values and eviews gives the following error message "Sizes do not match in matrix function"
I am trying the variancias put in a vector as follows:
w(!i)=var(x-y)
Can I perform adjust the series according to the missing values?

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

Re: data problem

Postby EViews Gareth » Sun Apr 26, 2009 9:04 am

Its not 100% clear what you're trying to achieve here, but assuming x and y are series, then the reason you're getting a size mis-match is that when you compute @var(x-y), the result is a series, not a scalar. There are two ways around this.

The first is to create a new series, Z = x-y, then store the variance of Z:

series z=x-y
w(!i) = @var(x-y)


The second method is to store the variance of x-y into a new series (with every value the same), and then put that number into your vector (note I am using the @max function here, but equally you could use @min, @mean etc...):
series var = @var(x-y)
w(!i) = @max(var)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests