Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: SPATGSA


From   Maurizio Pisati <[email protected]>
To   [email protected]
Subject   Re: st: SPATGSA
Date   Sun, 31 Oct 2010 07:02:40 +0100

Dear Ivan,
the problem is that your variable of interest (rd_int) contains missing values. Try this:


. use "/Users/Tonzolo/Downloads/moran_working.dta", clear
(Patents granted 1976-2006, incl. ipc and pdpass no)

. drop if rd_int==.
(168 observations deleted)

. su

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
       state |       343           6           0          6          6
 statecounty |       343    6061.659    27.60917       6001       6111
       gvkey |       343    10922.32    6591.155       1055      28279
        year |       343        1990           0       1990       1990
    latitude |       343    35.50675    1.959418   32.90462   39.64835
-------------+--------------------------------------------------------
   longitude |       343   -119.8231    2.134776  -122.7686  -116.8036
         sic |       343    3501.647    373.6784       2330       3949
      rd_int |       343    1.365108    9.319346          0   142.1818
      ad_int |       152    .0838932    .5656234          0   6.972574
     pat_int |       291    .2141094    1.592589          0         25

. spatwmat , name(wts) xcoord(longitude) ycoord(latitude) band(0, 1000)


The following matrix has been created:

1. Inverse distance weights matrix wts 
   Dimension: 343x343
   Distance band: 0 < d <= 1000
   Friction parameter: 1
   Minimum distance: 0.0      
   1st quartile distance: 0.5      
   Median distance: 3.2      
   3rd quartile distance: 5.4      
   Maximum distance: 8.2      
   Largest minimum distance: 1.53     
   Smallest maximum distance: 4.26     



. spatgsa rd_int, weights(wts) moran


Measures of global spatial autocorrelation


Weights matrix
--------------------------------------------------------------
Name: wts
Type: Distance-based (inverse distance)
Distance band: 0.0 < d <= 1000.0
Row-standardized: No
--------------------------------------------------------------

Moran's I
--------------------------------------------------------------
          Variables |    I      E(I)   sd(I)     z    p-value*
--------------------+-----------------------------------------
             rd_int | -0.002  -0.003   0.004   0.168   0.433
--------------------------------------------------------------
*1-tail test



. spatgsa rd_int, weights(wts) geary


Measures of global spatial autocorrelation


Weights matrix
--------------------------------------------------------------
Name: wts
Type: Distance-based (inverse distance)
Distance band: 0.0 < d <= 1000.0
Row-standardized: No
--------------------------------------------------------------

Geary's c
--------------------------------------------------------------
          Variables |    c      E(c)   sd(c)     z    p-value*
--------------------+-----------------------------------------
             rd_int |  0.871   1.000   0.268  -0.480   0.315
--------------------------------------------------------------
*1-tail test


Best wishes,
Maurizio









Il giorno 31/ott/2010, alle ore 04.34, Ivan Png ha scritto:

> Greetings!
> 
> I'm trying to estimate spatial correlation.  I gave the following commands:
> 
>         use moran_working.dta , clear
>         spatwmat , name(wts) xcoord(longitude) ycoord(latitude) band(0, 1000)
>         spatgsa rd_int , weights(wts) moran
> 
> The result was nothing:
> The following matrix has been created:
> 
> 1. Inverse distance weights matrix wts
>   Dimension: 511x511
>   Distance band: 0 < d <= 1000
>   Friction parameter: 1
>   Minimum distance: 0.0
>   1st quartile distance: 0.5
>   Median distance: 2.8
>   3rd quartile distance: 5.4
>   Maximum distance: 10.5
>   Largest minimum distance: 2.59
>   Smallest maximum distance: 5.79
> 
> 
> 
> .          spatgsa rd_int , weights(wts) moran
> 
> 
> Measures of global spatial autocorrelation
> 
> 
> Weights matrix
> --------------------------------------------------------------
> Name: wts
> Type: Distance-based (inverse distance)
> Distance band: 0.0 < d <= 1000.0
> Row-standardized: No
> --------------------------------------------------------------
> 
> Moran's I
> --------------------------------------------------------------
>          Variables |    I      E(I)   sd(I)     z    p-value*
> --------------------+-----------------------------------------
>             rd_int |      .  -0.002   0.003       .       .
> --------------------------------------------------------------
> *1-tail test
> 
> ======================
> 
> 
> I also tried
>         spatwmat , name(wts) xcoord(longitude) ycoord(latitude) band(0, 1000)
>         spatgsa rd_int , weights(wts) geary
> 
> and also got nothing:
> 
> The following matrix has been created:
> 
> 1. Inverse distance weights matrix wts
>   Dimension: 511x511
>   Distance band: 0 < d <= 1000
>   Friction parameter: 1
>   Minimum distance: 0.0
>   1st quartile distance: 0.5
>   Median distance: 2.8
>   3rd quartile distance: 5.4
>   Maximum distance: 10.5
>   Largest minimum distance: 2.59
>   Smallest maximum distance: 5.79
> 
> 
> 
> .          spatgsa rd_int , weights(wts) geary
> 
> 
> Measures of global spatial autocorrelation
> 
> 
> Weights matrix
> --------------------------------------------------------------
> Name: wts
> Type: Distance-based (inverse distance)
> Distance band: 0.0 < d <= 1000.0
> Row-standardized: No
> --------------------------------------------------------------
> 
> Geary's c
> --------------------------------------------------------------
>          Variables |    c      E(c)   sd(c)     z    p-value*
> --------------------+-----------------------------------------
>             rd_int |      .   1.000   0.187       .       .
> --------------------------------------------------------------
> *1-tail test
> 
> =====================
> 
> 
> I've had the same problem with hundreds of similar data-sets.
> Grateful for your help.  In case it would help in debugging, I've
> uploaded a sample data-set here:
> 
> http://www.comp.nus.edu.sg/~ipng/research/moran_working.dta
> 
> Many thanks
> Ivan Png
> 
> 
> 
> -- 
> Skype: ipng00
> T: +65 6516 6807
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index