Calculating conditional mean

For questions regarding programming in the EViews programming language.

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

Imhlanga
Posts: 6
Joined: Wed Jun 30, 2010 12:42 am

Calculating conditional mean

Postby Imhlanga » Wed Nov 16, 2011 7:26 am

Hi;
I want to calculate a conditional mean of a series, however i am new to Eviews proigraming. i have ordered observations from largest to smallest. what i want to do is to calculate the mean of all the observations that are smaller than a particular value x.

given a series y, i want to find the mean(y|y<x)

your help will be very much appreciated.

Thanks

Alexy.

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

Re: Calculating conditional mean

Postby EViews Gareth » Wed Nov 16, 2011 7:36 am

Code: Select all

smpl if y<x scalar mean = @mean(y)

Imhlanga
Posts: 6
Joined: Wed Jun 30, 2010 12:42 am

Re: Calculating conditional mean

Postby Imhlanga » Wed Nov 16, 2011 10:00 am

Thank you so much Gareth, now am going to finish my thesis! much appreciated.
Alexy


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests