Matrices
Matrices
' create workfile
wfcreate mcarlo u 1 10
' create data series for x
' NOTE: x is fixed in repeated samples
series x
x.fill 80, 100, 120, 140, 160, 180, 200, 220, 240, 260
' set seed for random number generator
rndseed 123456
' assign number of replications to a control variable
!reps = 100
' begin loop
for !i = 1 to !reps
' simulate y data
series y = 2.5 + 0.5*x + 3*nrnd
' regress y on a constant and x
equation eq1.ls y c x
next
' end of loop
' create workfile
wfcreate mcarlo u 1 10
' create data series for x
' NOTE: x is fixed in repeated samples
series x
x.fill 80, 100, 120, 140, 160, 180, 200, 220, 240, 260
' set seed for random number generator
rndseed 123456
' assign number of replications to a control variable
!reps = 100
' begin loop
for !i = 1 to !reps
' simulate y data
series y = 2.5 + 0.5*x + 3*nrnd
' regress y on a constant and x
equation eq1.ls y c x
next
' end of loop
' set workfile range to number of obs
wfcreate mcarlo u 1 10
' create data series for x
' NOTE: x is fixed in repeated samples
series x
x.fill 80, 100, 120, 140, 160, 180, 200, 220, 240, 260
' set seed for random number generator
rndseed 123456
' assign number of replications to a control variable
!reps = 100
' declare storage matrix
matrix(!reps,2) beta
' begin loop
for !i = 1 to !reps
' simulate y data
series y = 2.5 + 0.5*x + 3*nrnd
' regress y on a constant and x
equation eq1.ls y c x
' store each coefficient estimate in matrix
beta(!i,1) = eq1.@coefs(1) ' column 1 is intercept
beta(!i,2) = eq1.@coefs(2) ' column 2 is slope
next
' end of loop
' show descriptive stats of coef distribution
beta.stats
HISTOGRAMA Y SUS ESTADÍSTICAS
DESVIACIÓN ESTÁNDAR
Asimetría : skewness
Curtosis
JARQUE-BERA