Variance by month
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Variance by month
Is it possible to program a monthly series from a daily series where the monthly variable is the variance of the daily series?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Variance by month
Put the daily data in a daily workfile page.
Create a monthly page corresponding to those dates.
Copy the daily to the monthly performing a frequency conversion which averages the data over the high-frequency observations.
For programming, use the copy command to copy between the two pages.
Create a monthly page corresponding to those dates.
Copy the daily to the monthly performing a frequency conversion which averages the data over the high-frequency observations.
For programming, use the copy command to copy between the two pages.
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: Variance by month
How does the variance come into it though?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Variance by month
In the frequency conversion you can specify the method of going from high to low. One method is to take the variance of the high-frequency data corresponding to the lower frequency. Thus, the variance of the daily for each month is put into the corresponding month.
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: Variance by month
I see frequency conversion in the properties for the series but there doesnt seem to be the variance option you mention.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Variance by month
Code: Select all
'create some data and pages
wfcreate(page=mydaily) d7 1990 2000
series x=nrnd
'create monthly variance series
series monthly_variance = @varsby(x, @datefloor(@date, "MM"))
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: Variance by month
Thanks!
That seems to have worked. The variance I get isn't exactly the same as when I square the standard deviation in the stats table of a series with just one month of data, not sure why.
That seems to have worked. The variance I get isn't exactly the same as when I square the standard deviation in the stats table of a series with just one month of data, not sure why.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Variance by month
Population/sample difference
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: Variance by month
Sorry how do you mean? If I have a series and copy one month of data into a new series, the standard deviation should match up with the method you gave me for variance for that month, no?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Variance by month
Do you want the population variance or the sample variance? (I.e. Divide by n or n-1)
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: Variance by month
Oh I follow. When I put the one month of data in its own series my denominator is 12 instead of 11. Thanks again Gareth, you're the man
Who is online
Users browsing this forum: No registered users and 1 guest
