Group dummy variables

For questions regarding programming in the EViews programming language.

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

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Group dummy variables

Postby stefanp » Fri Mar 11, 2016 6:41 am

Hey there,

I have a bunch of dummy variables, say d_1_a, d_1_b,...,d_2_a, d_2_b etc. I would like to group them with something like:

Code: Select all

smpl @all for %j 1 2 3 4 for %k a b c d smpl @all string q = %j string r = %k group group_d_1_b "d_"+q+"_"+r next next
It doesnt really work, as the values of the group dummy variable are strings. I believe I mixed something up regarding the reference to the elements I want to group.

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

Re: Group dummy variables

Postby EViews Gareth » Fri Mar 11, 2016 7:04 am

Can't really see what you're trying to do.

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Re: Group dummy variables

Postby stefanp » Mon Mar 14, 2016 3:26 am

I have several dummy variables which are named according to the following structure:

d_1_a
d_2_a
d_1_b
d_2_b

etc.

I would like to create a variable (e.g. group_dummy) that groups all but one of the dummy variables. The idea is that I don't want to include all dummy variables (i.e. not the group) in a regression equation.

Does that make more sense?

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

Re: Group dummy variables

Postby EViews Glenn » Mon Mar 14, 2016 6:44 am

Code: Select all

group mygroup d_* mygroup.drop d_2_b equation eq01.ls y c d_2_b


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 0 guests