gwbr {gwbr} | R Documentation |
Geographically Weighted Beta Regression
Description
Fits a local regression model for each location using the beta distribution, recommended for rates and proportions, using a parametrization with mean (transformed by the link function) and precision parameter (called phi). For more details see Da Silva and Lima (2017).
Usage
gwbr(
yvar,
xvar,
lat,
long,
h,
data,
xglobal = NA_character_,
grid = data.frame(),
method = c("fixed_g", "fixed_bsq", "adaptative_bsq"),
link = c("logit", "probit", "loglog", "cloglog"),
distancekm = TRUE,
global = FALSE,
maxint = 100
)
Arguments
yvar |
A vector with the response variable name. |
xvar |
A vector with descriptive variable(s) name(s). |
lat |
A vector with the latitude variable name. |
long |
A vector with the longitude variable name. |
h |
The bandwidth parameter. |
data |
A data set object with |
xglobal |
A vector with descriptive variable(s) name(s) with global effect. |
grid |
A data set with the location variables. Only used when the location variable are in another data set, different from data set used in parameter |
method |
The kernel function used. The options are: |
link |
The link function used in modeling. The options are: |
distancekm |
Logical. If |
global |
Logical. If |
maxint |
A maximum number of iterations to numerically maximize the log-likelihood function in search of the parameter estimates. The default is |
Value
A list that contains:
-
parameter_estimates_qtls
- Parameter estimates quartiles and interquartile range. -
parameter_estimates_desc
- Parameter estimates mean, minimum and maximum. -
std_qtls
- Standard deviation quartiles and interquartile range. -
std_desc
- Standard deviation mean, minimum and maximum. -
est_n_parameters
- Number of parameters. -
est_gwr_parameters
- Effective number of parameters in the local model. -
phi
- Vector of precision parameter estimates. -
global_parameter
- Global parameter estimates, when existing. -
global_phi
- Global scale parameter estimate, when existing. -
global_parameter_tab
- Global parameter estimates table, when existing. -
residuals
- Table with observed values (y
), estimated values (yhat
), the link function applied in the estimated values (eta
), pure residual (res
), standardized residual (resstd
), standardized weighted residual 2 (resstd2
), residual deviance (resdeviance
), Cooks distance (cookD
), generalized leverage (glbp
) and number of iterations (iteration
). -
log_likelihood
- Log-likelihood of the fitted model. -
aicc
- Corrected Akaike information criterion. -
r2
- Pseudo R2 and adjusted pseudo R2 statistics. -
bp_test
- Breusch-Pagan test for heteroscedasticity. -
w
- Matrix of weights. -
parameters
- Table with parameter estimates of each model. -
significance
- Significance level of each model. -
bandwidth
- Bandwidth used. -
link_function
- The link function used in modeling.
Examples
data(saopaulo)
output_list=gwbr("prop_landline",c("prop_urb", "prop_poor"),"y","x",116.3647,saopaulo)
## Descriptive statistics of the parameter estimates
output_list$parameter_estimates_desc
## Table with all parameter estimates and your respective statistics
output_list$parameters