Hello,
I have created a (global) group with 310 variables. I would like to estimate a stepwise regression based on this grlobal group but I have too much variables in my (global) group for the estimation.
So, I would like to create K subgroup (with maximum 30 variables in each K subgroup) and each variables should be extracted from a random draws from the global group . I don't know how to program it? Do you have a solution? Thanks a lot
Ho to create a subgroup from a global group
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Ho to create a subgroup from a global group
Here's a bit of code that creates a workfile with 310 variables in it, puts them in a group, called G, then creates another group, called G3, that has a random selection of 30 of those variables.
Code: Select all
create u 100
group g
for !i=1 to 310
series x!i=nrnd
g.add x!i
next
copy g g2 'make a copy of the group
group g3
for !i=1 to 30
!rand = @floor((g2.@count*@rnd))+1 'generate a random number
%name = g2.@seriesname(!rand) 'select the series from the group
g3.add {%name} 'add it to group 3
g2.drop {%name} 'drop it from group 2 (to avoid replacement issues)
next
Re: Ho to create a subgroup from a global group
thanks a lot for your help !!
Who is online
Users browsing this forum: No registered users and 2 guests
