calculate the mean of returns only for a particular day

For questions regarding programming in the EViews programming language.

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

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

calculate the mean of returns only for a particular day

Postby Nau2306 » Thu Nov 17, 2011 12:03 pm

Hi

I am new to eviews and with a series of daily exchange rates, i am trying to calculate the mean of the returns only for the observations on a particular day, say only mondays, or tuesdays.

Can someone please help me?

Thanks

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

Re: calculate the mean of returns only for a particular day

Postby EViews Gareth » Thu Nov 17, 2011 12:16 pm

Set the sample to be Mondays only, then calculate the mean:

Code: Select all

smpl if @weekday=1 scalar monmean = @mean(returns)
where returns is the name of the series you're calculating the mean of.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Thu Nov 17, 2011 11:44 pm

thx loadzzz ! :)

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Thu Nov 17, 2011 11:54 pm

i am rily sry for disturbing u agen bt using the first command only, i fail to obtain the series with observations of Mondays only so that i can examine the descriptive statistics of this data set

thx

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

calculate the mean of returns only for a particular day

Postby EViews Gareth » Fri Nov 18, 2011 12:06 am

What do you mean by you fail?

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Fri Nov 18, 2011 12:29 am

i mean i did get the sample but not the series containing only the monday returns. I wish to examine the statistics for only monday returns, tuesday returns, wednesday returns and so on.

Thx

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: calculate the mean of returns only for a particular day

Postby startz » Fri Nov 18, 2011 7:27 am

How is your work file structured?

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Fri Nov 18, 2011 11:12 pm

meaning??

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: calculate the mean of returns only for a particular day

Postby startz » Sat Nov 19, 2011 9:13 am

All EViews workfiles have a structure: annual, monthly, "unstructured," etc.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Sat Nov 19, 2011 10:17 am

Oh ok... well its dated at daily frequency (7 day week).

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: calculate the mean of returns only for a particular day

Postby startz » Sat Nov 19, 2011 1:32 pm

Code: Select all

smpl if @weekday=1
limits the sample to Mondays.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: calculate the mean of returns only for a particular day

Postby Nau2306 » Sat Nov 19, 2011 11:47 pm

thanks... think i got it now


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests