Page 1 of 1

Group dummy variables

Posted: Fri Mar 11, 2016 6:41 am
by stefanp
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.

Re: Group dummy variables

Posted: Fri Mar 11, 2016 7:04 am
by EViews Gareth
Can't really see what you're trying to do.

Re: Group dummy variables

Posted: Mon Mar 14, 2016 3:26 am
by stefanp
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?

Re: Group dummy variables

Posted: Mon Mar 14, 2016 6:44 am
by EViews Glenn

Code: Select all

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