Package 'mgwrhw'

Title: Displays GWR (Geographically Weighted Regression) and Mixed GWR Output and Map
Description: Display processing results using the GWR (Geographically Weighted Regression) method, display maps, and show the results of the Mixed GWR (Mixed Geographically Weighted Regression) model which automatically selects global variables based on variability between regions. This function refers to Yasin, & Purhadi. (2012). "Mixed Geographically Weighted Regression Model (Case Study the Percentage of Poor Households in Mojokerto 2008)". European Journal of Scientific Research, 188-196. <https://www.researchgate.net/profile/Hasbi-Yasin-2/publication/289689583_Mixed_geographically_weighted_regression_model_case_study_The_percentage_of_poor_households_in_Mojokerto_2008/links/58e46aa40f7e9bbe9c94d641/Mixed-geographically-weighted-regression-model-case-study-The-percentage-of-poor-households-in-Mojokerto-2008.pdf>.
Authors: Asy-Syaja'ul Haqqul Amin [cre, aut], Waris Marsisno [aut]
Maintainer: Asy-Syaja'ul Haqqul Amin <[email protected]>
License: GPL-3
Version: 1.1.1.5
Built: 2025-02-16 05:17:21 UTC
Source: https://github.com/cran/mgwrhw

Help Index


mgwrhw

Description

displays the GWR and mixed GWR models automatically along with the tests and significance maps that are formed.

Usage

mgwrhw(dpk, pers.reg, coor_lat, coor_long, vardep, GWRonly, kp, alp)

Arguments

dpk

dataframe all variables that come from the shp data format and have geometric attributes that are usually imported with the st_read function from library(sf)

pers.reg

The form of the regression equation that will be used as a GWR model is in the general form y~x1+x2+x3

coor_lat

the name of the variable that is in the dpk dataframe that contains latitude coordinates and is written with quotation marks such as "Latitude" which indicates a column named Latitude

coor_long

the name of the variable that is in the dpk dataframe that contains latitude coordinates and is written with quotation marks such as "Longitude" which indicates a column named Longitude

vardep

the name of a variable that is in a dpk dataframe that contains one dependent variable and is written with quotation marks such as "y" which indicates a column named y

GWRonly

user option to choose to display GWR results only or to form an MGWR model. Option 1 displays GWR output only while option 0 displays GWR and MGWR output.

kp

user option to select kernel functions. Option 1 for Fixed Bisquare, option 2 for Fixed Gaussian, option 3 for Adaptive Bisquare, and option 4 for Adaptive Bisquare

alp

alpha value (type 1 error) used in spatial regression model

Value

no return value, called for side effects

This function returns a list with the following objects:

for Mixed GWR model (GWRonly = 0)

the general equation form of the Mixed GWR model is

yiy_{i} = β0\beta_{0}(uiu_{i},viv_{i}) + \sumβk\beta_{k}(uiu_{i},viv_{i})xikx_{ik} + \sumβk\beta_{k}xikx_{ik} + ϵi\epsilon_{i}

output

A character vector containing the captured output of GWR model and Mixed GWR model.

gwr

The result of the GWR model include CV, bandwith, Quasi R square, etc.

Variability.Test

Results of the variability test for global and local variables.

H0H_{0} : βk\beta_{k}(u1u_{1},v1v_{1}) = βk\beta_{k}(u2u_{2},v2v_{2}) = ... = βk\beta_{k}(unu_{n},vnv_{n})

H1H_{1} : not all βk\beta_{k}(uiu_{i},viv_{i}) (ii = 1, 2, ..., n) are equal

FVariability.Testk=Vk2/γ1σ^F_{Variability.Test_{k}} = \frac{V^{2}_{k}{/}\gamma_{1}}{\widehat{\sigma}}

Conclusion : Reject H0H_{0} if FVariability.TestkF_{Variability.Test_{k}} \geq FαF_{\alpha}(γ12γ2,δ12δ2\frac{\gamma_{1}^{2}}{\gamma_{2}},\frac{\delta_{1}^{2}}{\delta_{2}}) or p-value < α\alpha.

If H0H_{0} is rejected, it means that the k-th variable has a local influence, while if H0H_{0} fails to be rejected, it means that the k-th variable has a global influence.

Reference : Leung, Y., Mei, C.L., & Zhang, W.X., (2000). "Statistic Tests for Spatial Non-Stationarity Based on the Geographically Weighted Regression Model", Environment and Planning A, 32 pp. 9-32. doi:10.1068/a3162.

F1.F2.F3.mgwr.Test

Results of the F1(GoF Mixed GWR), F2(Global Simultaneous), F3(Local Simultaneous) tests.

F1(GoF Mixed GWR) :

H0H_{0} : βk\beta_{k}(uiu_{i},viv_{i}) = βk\beta_{k}

H1H_{1} : at least there is one βk\beta_{k}(uiu_{i},viv_{i}) \neq βk\beta_{k}

F(1)=yT((IH)(IS)T(IS))y/v1yT(IS)T(IS)y/u1F(1) = \frac{y^{T}((I-H)-(I-S)^{T}(I-S))y {/} v_{1}} {y^{T}(I-S)^{T}(I-S)y {/} u_{1}}

if H0H_{0} is rejected, it shows that the Mixed GWR model is different from the OLS model]

F2(Global Simultaneous) :

H0H_{0} : βq+1\beta_{q+1} = βq+2\beta_{q+2} = ... = βp\beta_{p} = 0

H1H_{1} : at least one of βk\beta_{k} \neq 0

F(2)=yT((ISl)T(ISl)(IS)T(IS))y/r1yT(IS)T(IS)y/u1F(2) = \frac{y^{T}((I-S_{l})^{T}(I-S_{l})-(I-S)^{T}(I-S))y {/} r_{1}} {y^{T}(I-S)^{T}(I-S)y {/} u_{1}}

If H0H_{0} is rejected, it indicates that there is at least one global variable that has a significant effect in the model

F3(Local Simultaneous)

H0H_{0} : β1\beta_{1}(uiu_{i},viv_{i}) = β2\beta_{2}(uiu_{i},viv_{i}) = ... = βq\beta_{q}(uiu_{i},viv_{i}) = 0

H1H_{1} : at least one of βk\beta_{k}(uiu_{i},viv_{i}) \neq 0

F(2)=yT((ISg)T(ISg)(IS)T(IS))y/r1yT(IS)T(IS)y/u1F(2) = \frac{y^{T}((I-S_{g})^{T}(I-S_{g})-(I-S)^{T}(I-S))y {/} r_{1}} {y^{T}(I-S)^{T}(I-S)y {/} u_{1}}

If H0H_{0} is rejected, it indicates that there is at least one local variable that has a significant effect in the model

Reference : Yasin, & Purhadi. (2012). "Mixed Geographically Weighted Regression Model (Case Study the Percentage of Poor Households in Mojokerto 2008)". European Journal of Scientific Research, 188-196. https://www.researchgate.net/profile/Hasbi-Yasin-2/publication/289689583_Mixed_geographically_weighted_regression_model_case_study_The_percentage_of_poor_households_in_Mojokerto_2008/links/58e46aa40f7e9bbe9c94d641/Mixed-geographically-weighted-regression-model-case-study-The-percentage-of-poor-households-in-Mojokerto-2008.pdf.

Global.Partial.Test

Results of the global partial test.

H0H_{0} : βk\beta_{k} = 0 (k-th global variables are not significant)

H1H_{1} : βk\beta_{k} \neq 0 (k-th global variables are significant)

Tg=βk^σ^gkkT_{g} = \frac{\widehat{\beta_{k}}}{\widehat{\sigma}\sqrt{g_{kk}}}

If H0H_{0} is rejected, it indicates that the k-th global variable has a significant effect

Reference : Yasin, & Purhadi. (2012). "Mixed Geographically Weighted Regression Model (Case Study the Percentage of Poor Households in Mojokerto 2008)". European Journal of Scientific Research, 188-196. https://www.researchgate.net/profile/Hasbi-Yasin-2/publication/289689583_Mixed_geographically_weighted_regression_model_case_study_The_percentage_of_poor_households_in_Mojokerto_2008/links/58e46aa40f7e9bbe9c94d641/Mixed-geographically-weighted-regression-model-case-study-The-percentage-of-poor-households-in-Mojokerto-2008.pdf.

map.mgwr

Visualization of Mixed GWR results in the form of a regional map with variables that are significant globally and locally.

Global_variable

A list of global variables used in the analysis.

Local_variable

A list of local variables used in the analysis.

AICc

The corrected Akaike Information Criterion.

AIC

The Akaike Information Criterion.

R_square

The coefficient of determination.

adj_R_square

The adjusted coefficient of determination.

table.mgwr

A data frame about output table of MGWR model (include estimator, standar error, t-statistics, p-value).

for GWR model (GWRonly = 1)

the general equation form of the GWR model is

yiy_{i} = β0\beta_{0}(uiu_{i},viv_{i}) + \sumβk\beta_{k}(uiu_{i},viv_{i})xikx_{ik} + ϵi\epsilon_{i}

output

A character vector containing the captured output of GWR model.

gwr

A character vector containing the result of the GWR model include CV, bandwith, Quasi R square, etc.

GoF.test

A character vector containing the results of the Godness of Fit Test.

anova_gwr

Results of the anova table.

map.gwr

Visualization of the GWR results.

table.gwr

A data frame about output table of GWR model (include estimator, standar error, t-statistics, p-value).

Examples

mod1 = mgwrhw(dpk=redsb, pers.reg = Y ~ X2 + X4 + X5 + X6,
coor_lat = "Latitude", coor_long = "Longitude",
vardep = "Y", GWRonly = 0, kp = 3, alp = 0.05)
mod1$gwr
mod1$Variability.Test
mod1$Global_variable
mod1$Local_variable
mod1$F1.F2.F3.mgwr.Test
mod1$Global.Partial.Test
mod1$map.mgwr

Data to show stunting prevalence in every district from an island

Description

Data to show stunting prevalence in every district from an island

Usage

redsb

Format

An object of class sf (inherits from data.frame) with 33 rows and 15 columns.