Calculating By Group Statistics only for cross sections with more than 3 annual observations

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

GraemeSmith
Posts: 3
Joined: Sun May 27, 2018 5:00 pm

Calculating By Group Statistics only for cross sections with more than 3 annual observations

Postby GraemeSmith » Wed Jul 11, 2018 6:41 am

Hi All,

I want to calculate by-group standard deviations for each fund (cross section) in my 2001-2017 sample, however, I only want to do so for funds with more than 3 annual observations to improve the robustness of the standard deviation measure and subsequent analysis. How would I go about doing this?

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

Re: Calculating By Group Statistics only for cross sections with more than 3 annual observations

Postby EViews Gareth » Wed Jul 11, 2018 7:35 am

Code: Select all

show @stdevsby(y, @crossid, "if @obsby(y, @crossid)>3")
Follow us on Twitter @IHSEViews

GraemeSmith
Posts: 3
Joined: Sun May 27, 2018 5:00 pm

Re: Calculating By Group Statistics only for cross sections with more than 3 annual observations

Postby GraemeSmith » Wed Jul 11, 2018 8:56 am

Thanks for the prompt response Gareth, it worked!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 12 guests