descriptive statistics sorted and weighted

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

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

Camille
Posts: 1
Joined: Wed May 07, 2025 4:40 am

descriptive statistics sorted and weighted

Postby Camille » Thu May 08, 2025 2:30 pm

Hello I need help for basic descriptive statistics.

I have a country-panel dataset which includes a weighting variable (reflecting the design and stratification weight). I would like first to perform the weighted descriptive statistics. Especially I would like to have the means sorted by countries (as with the "by classification" option) and calculated as:
Mean_of_variable_X (i,c) = [Sum_over i of X (i,c)*weight(i,c)] / [Sum_over i of weight(i,c)]
i represents the individuals and c the countries.

For now, I programmed very inelegantly in creating a series = @sumsby(X*weight,cntry)/@sumsby(weight,cntry)
And then provide the wished table with X.statby cntry

Is there a built in command for this purpose that I missed? Is there a more direct way?

Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest