Generate Median from a Time Series of Frequency Tables

For questions regarding programming in the EViews programming language.

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

smythson
Posts: 1
Joined: Thu May 19, 2016 4:23 pm

Generate Median from a Time Series of Frequency Tables

Postby smythson » Thu May 19, 2016 4:55 pm

I have a panel/pooled data set with time series for ~15 cross sections. For each cross section I have one series of monthly data points and a second series that gives the number of observations for each of the monthly data points.

So for the first cross section: (X1_1, X2,_1, X3_1,...XT_1), and the second cross section (X1_2, X2,_2, X3_2,...XT_2), etc...

and alongside that,

(N1_1, N2_1, N3_1,...NT_1), (N1_2, N2_2, N3_2,...NT_2), and so on. . .

For example, if X1_1 = 10 and N1_1 = 100, that means there are 100 '10s', and if X1_2 = 5 and N1_2 = 50 there are 50 '5s' -- so the raw data is effectively like a time series of frequency tables. I want to take generate a third series with the median across all of the cross sections for every month, but it seems I would not be able to do this without having to separetely generate a very long expanded vector, e.g. 50 '5s' stacked on top of 100 '10s'.

Is there a more efficient way of writing this code in EViews?

Thank you!

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests