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?
data problem
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: data problem
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)
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)
Who is online
Users browsing this forum: No registered users and 2 guests
