spatial_hetero_test.hgwrm | R Documentation |
A Hierarchical Linear Model (HLM) with group-level geographically weighted effects.
## S3 method for class 'hgwrm'
spatial_hetero_test(
x,
round = 99,
statistic = stat_glsw,
parallel = FALSE,
verbose = 0,
...
)
hgwr(
formula,
data,
...,
bw = "CV",
kernel = c("gaussian", "bisquared"),
alpha = 0.01,
eps_iter = 1e-06,
eps_gradient = 1e-06,
max_iters = 1e+06,
max_retries = 1e+06,
ml_type = c("D_Only", "D_Beta"),
f_test = FALSE,
verbose = 0
)
## S3 method for class 'sf'
hgwr(
formula,
data,
...,
bw = "CV",
kernel = c("gaussian", "bisquared"),
alpha = 0.01,
eps_iter = 1e-06,
eps_gradient = 1e-06,
max_iters = 1e+06,
max_retries = 1e+06,
ml_type = c("D_Only", "D_Beta"),
f_test = FALSE,
verbose = 0
)
## S3 method for class 'data.frame'
hgwr(
formula,
data,
...,
coords,
bw = "CV",
kernel = c("gaussian", "bisquared"),
alpha = 0.01,
eps_iter = 1e-06,
eps_gradient = 1e-06,
max_iters = 1e+06,
max_retries = 1e+06,
ml_type = c("D_Only", "D_Beta"),
f_test = FALSE,
verbose = 0
)
hgwr_fit(
formula,
data,
coords,
bw = c("CV", "AIC"),
kernel = c("gaussian", "bisquared"),
alpha = 0.01,
eps_iter = 1e-06,
eps_gradient = 1e-06,
max_iters = 1e+06,
max_retries = 1e+06,
ml_type = c("D_Only", "D_Beta"),
f_test = FALSE,
verbose = 0
)
x |
An |
round |
The number of times to sampling from model. |
statistic |
A function used to calculate the statistics on the original data and bootstrapped data. Default to the variance of standardlised GLSW estimates. |
parallel |
If TRUE, use |
verbose |
An integer value. Determine the log level. Possible values are:
|
... |
Further arguments for the specified type of |
formula |
A formula.
Its structure is similar to response ~ L(glsw) + fixed + (random | group) For more information, please see the |
data |
The data. |
bw |
A numeric value. It is the value of bandwidth or |
kernel |
A character value. It specify which kernel function is used in GWR part. Possible values are
|
alpha |
A numeric value. It is the size of the first trial step in maximum likelihood algorithm. |
eps_iter |
A numeric value. Terminate threshold of back-fitting. |
eps_gradient |
A numeric value. Terminate threshold of maximum likelihood algorithm. |
max_iters |
An integer value. The maximum of iteration. |
max_retries |
An integer value. If the algorithm tends to be diverge, it stops automatically after trying max_retires times. |
ml_type |
An integer value. Represent which maximum likelihood algorithm is used. Possible values are:
|
f_test |
A logical value. Determine whether to do F test on GLSW effects.
If |
coords |
A 2-column matrix. It consists of coordinates for each group. |
In the HGWR model, there are three types of effects specified by the
formula
argument:
Effects wrapped by functional symbol L
.
Effects specified outside the functional symbol L
but to the left of symbol |
.
Other effects
For example, the following formula in the example of this function below is written as
y ~ L(g1 + g2) + x1 + (z1 | group)
where g1
and g2
are GLSW effects,
x1
is the fixed effects,
and z1
is the SLR effects grouped by the group indicator group
.
Note that SLR effects can only be specified once!
A list describing the model with following fields.
gamma
Coefficients of group-level spatially weighted effects.
beta
Coefficients of fixed effects.
mu
Coefficients of sample-level random effects.
D
Variance-covariance matrix of sample-level random effects.
sigma
Variance of errors.
effects
A list including names of all effects.
call
Calling of this function.
frame
The DataFrame object sent to this call.
frame.parsed
Variables extracted from the data.
groups
Unique group labels extracted from the data.
f_test
A list of F test for GLSW effects. Only exists when f_test=TRUE
. Each item contains the F value, degrees of freedom in the numerator, degrees of freedom in the denominator, and p
value of F>F_\alpha
.
spatial_hetero_test(hgwrm)
: Test the spatial heterogeneity with bootstrapping.
hgwr_fit()
: Fit a HGWR model
data(mulsam.test)
hgwr(
formula = y ~ L(g1 + g2) + x1 + (z1 | group),
data = mulsam.test$data,
coords = mulsam.test$coords,
bw = 10
)
mod_Ftest <- hgwr(
formula = y ~ L(g1 + g2) + x1 + (z1 | group),
data = mulsam.test$data,
coords = mulsam.test$coords,
bw = 10
)
summary(mod_Ftest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.