
%This example program uses Delaunay weights with the data from:
%Pace, R. Kelley, and Ronald Barry, Quick Computation of Regressions with a Spatially Autoregressive Dependent Variable,
%Geographical Analysis, Volume 29, Number 3, July 1997, p. 232-247. 

%This routine fits a model Y=[X (spatially lagged X=DX)]*parameters+intercept+error
%This provides the likelihood ratio tests for each separate independent variable, lagged or not lagged
%It differs from the example in xlagx1 only in the inference provided

%Written by Kelley Pace, 6/23/97



%This example uses Delaunay weights

load xsub;
load y;
load wwsdel;
wws=wwsdel;



tic;
[alphamax,loglik,emax,bmax,likratios,prhigher]=flagx2(xsub,y,wws);
toc

elapsed_time =

    0.2410


alphamax

alphamax =

     0


bmax

bmax =

   -0.7320
    0.2041
    0.4570
    0.0249
   -0.0571
    0.4356
   -0.0766
   -0.2919
    1.2006


loglik

loglik =

  1.0e+003 *

  Columns 1 through 7 

   -6.2240   -6.5139   -6.2479   -6.4699   -6.2244   -6.2249   -6.3025

  Columns 8 through 10 

   -6.2266   -6.2535   -6.4204


[ likratios prhigher]

ans =

  579.6995         0
   47.6889    0.0000
  491.7993         0
    0.7792    0.3774
    1.7852    0.1815
  156.9209         0
    5.2422    0.0220
   58.9027    0.0000
  392.8317         0




diary off;
