By-Group Stats

For questions regarding programming in the EViews programming language.

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

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

By-Group Stats

Postby tchaithonov » Wed Dec 29, 2010 10:38 am

Hey Guys, Happy Holidays!

I wonder if there is a way to create by-group stats (using @kurtsby as an example) for a bunch of variables in a panel model all at once (without looping (k+1) times) and write the results to a matrix/table (one value per variable per cross section) without creating another table/series/group? I just want to have a clean (n*t)*k matrix that I could further lookup on. If all of these are not possible, is there an easier way to just write the value of each cross section to a table/matrix than looping it t times to get the (n*(t-1))+1 value (that's just the 1st value of each cross section, n is max of cellid)? Please let me know. Thanks.

Tchaithonov

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: By-Group Stats

Postby EViews Glenn » Wed Dec 29, 2010 12:02 pm

If I'm understanding the question correctly (a big *if*, I know), what I'd probably do is to create a workfile with only the cross-section identifiers (or whatever the by-stat is for), then copy the group containing all of the series into the new page with the appropriate contraction. You can stom in the new page to get a matrix. Bring the matrix back and then delete the temporary page if desired.

P.S. - If the above doesn't correspond to your problem then I'm not following all of your dimensions (k is the variables, n is the number of cross-sections, t is time? -- if the latter, then why do we need to loop t times to get values?)

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: By-Group Stats

Postby tchaithonov » Wed Dec 29, 2010 8:57 pm

yeah, you are right about the dimensions, I was wrong about the looping, it's n not t.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: By-Group Stats

Postby EViews Glenn » Thu Dec 30, 2010 10:18 am

Is the suggested method going to work for you?

By the way, you can use pagecreate(id) to generate the new page...

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: By-Group Stats

Postby tchaithonov » Fri Dec 31, 2010 8:31 pm

Hey Glenn,

Haven't tried .. but what I am doing is a variation of the rolling regression add-in. I am trying to calculate the stat of each variable per run and take out the variable(s) that do not have any variations (stdevsby and means give zeros, only kurtsby gives a NA) instead of having the regression run to an error. I don't know if pagecreat-ing the stats each time is efficient at all. But I will think about what you said and try it out before I plan the next step. Thanks tho.

Happy New Year!

Tchaithonov


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests