SHAZAM Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

LM Autocorrelation problem with Weight option

I use the following command to calculate LM Autocorrelation test, without weight option no problem but the problem with weight option I got different results why?

here is the code: Sample 1 17 Read T Y X1 X2 1 99.20 96.70 101.0 2 99.00 98.10 100.1 3 100.0 100.0 100.0 4 111.6 104.9 90.60 5 122.2 104.9 86.50 6 117.6 109.5 89.70 7 121.1 110.8 90.60 8 136.0 112.3 82.80 9 154.2 109.3 70.10 10 153.6 105.3 65.40 11 158.5 101.7 61.30 12 140.6 95.40 62.50 13 136.2 96.40 63.60 14 168.0 97.60 52.60 15 154.3 102.4 59.70 16 149.0 101.6 59.50 17 165.5 103.8 61.30 Set NODEL OLS Y X1 X2 / Resid=E Weight=X2 ut diag / acf Gen E1=Lag(E,1) ?OLS E E1 x1 x2 /
Gen1 Sqrt($N*$R2)

|_Set NODEL
 |_?OLS Y X1 X2 / Resid=E ut
 |_diag / acf

 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
    1.06170962850      -1.38298545741       130.706587487

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1455     0.2425    -0.5998     0.7014     2.0185     0.4272
    2    -0.2231     0.2425    -0.9200     1.2257     2.0359     1.4994
    3     0.1871     0.2425     0.7716     0.9975     1.1956     2.3074
    4    -0.3002     0.2425    -1.2377     1.7388     2.0133     4.5462
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.333

 |_Gen E1=Lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.28942E-01
  0.70143480

 |_?OLS Y X1 X2 / Resid=E Weight=X2 ut 
 |_diag / acf
 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
   0.975798381981      -1.36603123581       138.217582873

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1453     0.2425    -0.5990     0.6957     2.0257     0.4261
    2    -0.2332     0.2425    -0.9615     1.2576     2.0795     1.5972
    3     0.1883     0.2425     0.7762     1.0115     1.2232     2.4148
    4    -0.3195     0.2425    -1.3174     1.8588     2.0829     4.9515
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.621

 |_Gen E1=Lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.31908E-01
  0.73650384

LM Autocorrelation problem with Weight option

I use the following command to calculate LM Autocorrelation test, without weight option no problem but the problem with weight option I got different results why?

here is the code: Sample 1 17 Read T Y X1 X2 1 99.20 96.70 101.0 2 99.00 98.10 100.1 3 100.0 100.0 100.0 4 111.6 104.9 90.60 5 122.2 104.9 86.50 6 117.6 109.5 89.70 7 121.1 110.8 90.60 8 136.0 112.3 82.80 9 154.2 109.3 70.10 10 153.6 105.3 65.40 11 158.5 101.7 61.30 12 140.6 95.40 62.50 13 136.2 96.40 63.60 14 168.0 97.60 52.60 15 154.3 102.4 59.70 16 149.0 101.6 59.50 17 165.5 103.8 61.30 61.30

Set NODEL OLS ?OLS Y X1 X2 / Resid=E Weight=X2 ut diag / acf Gen E1=Lag(E,1) ?OLS E E1 x1 x2 /
Gen1 Sqrt($N*$R2)

?OLS Y X1 X2 / Resid=E Weight=X2 ut diag / acf Gen E1=Lag(E,1) ?OLS E E1 x1 x2 /
Gen1 Sqrt($N*$R2)

|_Set NODEL
 |_?OLS Y X1 X2 / Resid=E ut
 |_diag / acf

 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
    1.06170962850      -1.38298545741       130.706587487

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1455     0.2425    -0.5998     0.7014     2.0185     0.4272
    2    -0.2231     0.2425    -0.9200     1.2257     2.0359     1.4994
    3     0.1871     0.2425     0.7716     0.9975     1.1956     2.3074
    4    -0.3002     0.2425    -1.2377     1.7388     2.0133     4.5462
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.333

 |_Gen E1=Lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.28942E-01
  0.70143480

 |_?OLS Y X1 X2 / Resid=E Weight=X2 ut 
 |_diag / acf
 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
   0.975798381981      -1.36603123581       138.217582873

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1453     0.2425    -0.5990     0.6957     2.0257     0.4261
    2    -0.2332     0.2425    -0.9615     1.2576     2.0795     1.5972
    3     0.1883     0.2425     0.7762     1.0115     1.2232     2.4148
    4    -0.3195     0.2425    -1.3174     1.8588     2.0829     4.9515
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.621

 |_Gen E1=Lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.31908E-01
  0.73650384

LM Autocorrelation problem with Weight option

I use the following command to calculate an LM Autocorrelation test, without weight test. Without the WEIGHT option there is no problem problem, but the problem with weight option WEIGHT option was that I got different results why?results. Why?

here Here is the code: Sample code:

sample 1 17
Read read T Y X1 X2
1   99.20  96.70  101.0
2   99.00  98.10  100.1
3   100.0  100.0  100.0
4   111.6  104.9  90.60
5   122.2  104.9  86.50
6   117.6  109.5  89.70
7   121.1  110.8  90.60
8   136.0  112.3  82.80
9   154.2  109.3  70.10
10  153.6  105.3  65.40
11  158.5  101.7  61.30
12  140.6  95.40  62.50
13  136.2  96.40  63.60
14  168.0  97.60  52.60
15  154.3  102.4  59.70
16  149.0  101.6  59.50
17  165.5  103.8  61.30

Set 61.30 set NODEL ?OLS Y X1 X2 / Resid=E resid=E ut diag / acf Gen gen E1=lag(E,1) ?OLS E E1 x1 x2 / gen1 sqrt($N*$R2) ?OLS Y X1 X2 / resid=E weight=X2 ut diag / acf gen E1=Lag(E,1) ?OLS E E1 x1 x2 /
Gen1 Sqrt($N*$R2)
gen1 sqrt($N*$R2)

?OLS Y X1 X2 / Resid=E Weight=X2 ut diag / acf Gen E1=Lag(E,1) ?OLS E E1 x1 x2 /
Gen1 Sqrt($N*$R2)
Here is the output:

|_Set |_set NODEL
 |_?OLS Y X1 X2 / Resid=E resid=E ut
 |_diag / acf

 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
    1.06170962850      -1.38298545741       130.706587487

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1455     0.2425    -0.5998     0.7014     2.0185     0.4272
    2    -0.2231     0.2425    -0.9200     1.2257     2.0359     1.4994
    3     0.1871     0.2425     0.7716     0.9975     1.1956     2.3074
    4    -0.3002     0.2425    -1.2377     1.7388     2.0133     4.5462
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.333

 |_Gen E1=Lag(E,1)
|_gen E1=lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
|_gen1  sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.28942E-01
  0.70143480

 |_?OLS Y X1 X2 / Resid=E Weight=X2 resid=E weight=X2 ut 
 |_diag / acf
 REQUIRED MEMORY IS PAR=       5 CURRENT PAR=  112400
 DEPENDENT VARIABLE = Y               17 OBSERVATIONS
 REGRESSION COEFFICIENTS
   0.975798381981      -1.36603123581       138.217582873

 RESIDUAL CORRELOGRAM
  LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
  LAG     RHO       STD ERR     T-STAT     LM-STAT    DW-TEST BOX-PIERCE-LJUNG
    1    -0.1453     0.2425    -0.5990     0.6957     2.0257     0.4261
    2    -0.2332     0.2425    -0.9615     1.2576     2.0795     1.5972
    3     0.1883     0.2425     0.7762     1.0115     1.2232     2.4148
    4    -0.3195     0.2425    -1.3174     1.8588     2.0829     4.9515
 LM CHI-SQUARE STATISTIC WITH   4  D.F. IS     3.621

 |_Gen E1=Lag(E,1)
|_gen E1=lag(E,1)
 ...NOTE..LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
 |_?OLS E E1 x1 x2 /
 |_Gen1  Sqrt($N*$R2)
|_gen1  sqrt($N*$R2)
 ...NOTE..CURRENT VALUE OF $N   =   17.000
 ...NOTE..CURRENT VALUE OF $R2  =  0.31908E-01
  0.73650384