Monte Carlo of STEPWISE regression
Posted: Mon Jun 09, 2014 1:55 pm
Hello.
I’m using EViews 8. I’m a beginner. There are too many challenges that I cannot handle. Please help.
The data file is small and simple. The number of observations is 50. There are six variables: y, x1, x2, x3, x4, and x5.
I’d like to do a Monte Carlo simulation of ‘stepwise OLS regression’ and find the probability of specifying the true model (i.e., y=f(x1, x2, x3)), or the percent of true models among the 1000 repetitions. I’d like to run the simulation on different sample sizes (i.e., n=50 and n=100) and different standard deviations of the stochastic component (sigma=0.7 and sigma=0.4).
Thus, there are four different settings:
(1) equation mc1.stepls y @ x1 x2 x3 x4 x5 0.7*@rnorm ‘ n=50
(2) equation mc2.stepls y @ x1 x2 x3 x4 x5 0.4*@rnorm ‘ n=50
(3) equation mc3.stepls y @ x1 x2 x3 x4 x5 0.7*@rnorm ‘ n=100
(4) equation mc4.stepls y @ x1 x2 x3 x4 x5 0.4*@rnorm ‘ n=100
The first challenge that I’m faced with is sampling. How can I sample 100 observations when there are actually 50 observations in the data?
The second challenge is storing the results. I know how to store some of the statistics (such as @coef(1) or @aic) in vectors or matrices; but what I have to store is the list of variables that are selected so that I can count the number of correct models among the 1000 replications.
Would you please help me? Thank you very much in advance.
Rakkoo
I’m using EViews 8. I’m a beginner. There are too many challenges that I cannot handle. Please help.
The data file is small and simple. The number of observations is 50. There are six variables: y, x1, x2, x3, x4, and x5.
I’d like to do a Monte Carlo simulation of ‘stepwise OLS regression’ and find the probability of specifying the true model (i.e., y=f(x1, x2, x3)), or the percent of true models among the 1000 repetitions. I’d like to run the simulation on different sample sizes (i.e., n=50 and n=100) and different standard deviations of the stochastic component (sigma=0.7 and sigma=0.4).
Thus, there are four different settings:
(1) equation mc1.stepls y @ x1 x2 x3 x4 x5 0.7*@rnorm ‘ n=50
(2) equation mc2.stepls y @ x1 x2 x3 x4 x5 0.4*@rnorm ‘ n=50
(3) equation mc3.stepls y @ x1 x2 x3 x4 x5 0.7*@rnorm ‘ n=100
(4) equation mc4.stepls y @ x1 x2 x3 x4 x5 0.4*@rnorm ‘ n=100
The first challenge that I’m faced with is sampling. How can I sample 100 observations when there are actually 50 observations in the data?
The second challenge is storing the results. I know how to store some of the statistics (such as @coef(1) or @aic) in vectors or matrices; but what I have to store is the list of variables that are selected so that I can count the number of correct models among the 1000 replications.
Would you please help me? Thank you very much in advance.
Rakkoo