Posts

Showing posts with the label Stata

Create Spatial Weight Matrix for Provinces in Java Island

Image
The spatial weight matrix is one crucial component in the spatial analysis models as it represents the relationship between one region with others. There are two kinds of spatial weighting matrix: contiguity and distance-based matrix. In a contiguity matrix, two regions are considered as neighbour if they share the same border, that represented with 1 symbol. While not neighbouring regions will be coded 0. On the other hand, each cell in the distance-based matrix shows the distance between the two regions.   Figure 1. Java Island, Indonesia In this article, we will create a spatial weight matrix of provinces in Java Island (Figure 1). For the six provinces in Java Island, there will be a 6x6 matrix. The creation of a contiguity matrix should be started by identifying the relationship status between one region and others (Table 1).   Then, the contiguity matrix is created (Table 2) Table 1. The Relationship between Regions Table 2. Contiguity Matrix One drawback ...

What is the Proportion of Debts Owned by Different Classes in Indonesia?

Image
An Application of Jann (2016) for Concentration Shares of Wealth in Indonesia, 2014   We may want to know how household debts are distributed across classes in Indonesia. In this example, the classes are based on total wealth value. Thus, one may ask how many debts are owned by the 10% poorest households? or do the 10% richest households hold the largest percentage of debts? We start the estimation by describing the distribution of total wealth (Table 1 and Figure 1). There is an unequal distribution of total wealth in Indonesia, where 10% of the poorest household held 0.11% of total wealth, while 10% of the richest households hold 51.09% of total wealth. Similar results are found when implementing - pshare - command (Table 2 and Figure 2). Table 1.  Total Wealth Distribution Figure 1. Total Wealth Distribution Table 2.  Total Wealth Distribution by using Jann (2016) Figure 2. Total Wealth Distribution by using Jann (2016)  Then, how many debts owned by eac...

Error in Stata: add new variable in Mata

Image
One example of error in Mata is when executing spgen command, i.e. creating spatially lagged variables. In this case, variable name is netwealth_riil_hhadj_avg spgen netwealth_riil_hhadj_avg, lon(longitude) lat(latitude) swm(bin) dist(200) dunit(km) will give error as below. splag1_netwealth_riil_hhadj_avg_b invalid name              st_addvar():   3300   argument out of range              calcsplag():      -   function returned error                  <istmt>:      -   function returned error This error must be read in a reversed order (traceback log), i.e. from bottom to top. The problem is when we type the command (the <istmt> ), it called the calcsplag() , and calcsplag() called st...