Hi Statalisters
I am working on spatial autocorrelation using Moran's I with the -moransi- command. I am having some issues with obtaining sensible results and hope that someone may provide input. I have searched for information, but have not found any helpful information on this specific issue. Perhaps other commands for Moran's I may be more suitable.
I have a data set at municipality level (-munic-) with the variable of interest, -diag_frac-, and variables for longitude and latitude. I have an additional variable -group- with values "1001.x" where x varies for over municipality codes. For example, I have 332 rows for the first municipality and group goes from 1001.1 to 1001.12.
When I follow the -moransi- syntax, I get the following error message:
When I use the group variable, I get output (although not very helpful):
Here is an overview of the 10 first observations of 116061 observations:
I am working on spatial autocorrelation using Moran's I with the -moransi- command. I am having some issues with obtaining sensible results and hope that someone may provide input. I have searched for information, but have not found any helpful information on this specific issue. Perhaps other commands for Moran's I may be more suitable.
I have a data set at municipality level (-munic-) with the variable of interest, -diag_frac-, and variables for longitude and latitude. I have an additional variable -group- with values "1001.x" where x varies for over municipality codes. For example, I have 332 rows for the first municipality and group goes from 1001.1 to 1001.12.
When I follow the -moransi- syntax, I get the following error message:
Code:
. moransi diag_frac, lat(latitude) lon(longitude) swm(pow 3) dist(.) dunit(km) J(): 3900 unable to allocate real <tmp>[114695,114695] calcmoransi(): - function returned error <istmt>: - function returned error r(3900);
Code:
. moransi group, lat(latitude) lon(longitude) swm(bin) dist(.) dunit(km) Size of spatial weight matrix: 0 Distance by Vincenty formula (unit: km) Moran's I Statistic Number of Obs = 0 ----------------------------------------------------------------------------- Variable | Moran's I E(I) SE(I) Z(I) p-value -------------+--------------------------------------------------------------- group | . 1.00000 . . . ----------------------------------------------------------------------------- Null Hypothesis: Spatial Randomization
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float munic str7 group float diag_frac double(longitude latitude) 1001 "1001.1" .0509536 8.185135324837832 58.14294309988497 1001 "1001.1" .0509536 8.179071228942883 58.13995776977048 1001 "1001.1" .0509536 8.18477560553609 58.138102104784736 1001 "1001.1" .0509536 8.178954613870598 58.131509307117305 1001 "1001.1" .0509536 8.180801932069118 58.12889646551324 1001 "1001.1" .0509536 8.174042784729531 58.12817274934762 1001 "1001.1" .0509536 8.169978388722278 58.125305063606575 1001 "1001.1" .0509536 8.164428225382006 58.12786257501244 1001 "1001.1" .0509536 8.151078440231464 58.12925255793769 1001 "1001.1" .0509536 8.15233806989138 58.12608493338922 end
Comment