GWPR.pFtest: Locally F Test Based on GWPR

View source: R/GWPR.pFtest.R

GWPR.pFtestR Documentation

Locally F Test Based on GWPR

Description

This function perform F test in each regression based on different subsamples

Usage

GWPR.pFtest(formula, data, index, SDF, bw = NULL, adaptive = FALSE, p = 2,
                   effect = "individual", kernel = "bisquare", longlat = FALSE)

Arguments

formula

The regression formula: : Y ~ X1 + ... + Xk

data

A data.frame for the Panel data.

index

A vector of the two indexes: (c("ID", "Time")).

SDF

Spatial*DataFrame on which is based the data, with the "ID" in the index.

bw

The optimal bandwidth, either adaptive or fixed distance.

adaptive

If TRUE, adaptive distance bandwidth is used, otherwise, fixed distance bandwidth.

p

The power of the Minkowski distance, default is 2, i.e. the Euclidean distance

effect

The effects introduced in the fixed effects model, one of "individual" (default) , "time", "twoways"

kernel

bisquare: wgt = (1-(vdist/bw)^2)^2 if vdist < bw, wgt=0 otherwise (default); gaussian: wgt = exp(-.5*(vdist/bw)^2); exponential: wgt = exp(-vdist/bw); tricube: wgt = (1-(vdist/bw)^3)^3 if vdist < bw, wgt=0 otherwise; boxcar: wgt=1 if dist < bw, wgt=0 otherwise

longlat

If TRUE, great circle distances will be calculated

Value

A list of result:

GW.arguments

a list class object including the model fitting parameters for generating the report file

SDF

a Spatial*DataFrame (either Points or Polygons, see sp) integrated with fit.points, test value, p value, df1, df2

Author(s)

Chao Li <chaoli0394@gmail.com> Shunsuke Managi

Examples

data(TransAirPolCalif)
data(California)
formula.GWPR <- pm25 ~ co2_mean + Developed_Open_Space_perc + Developed_Low_Intensity_perc +
   Developed_Medium_Intensity_perc + Developed_High_Intensity_perc +
   Open_Water_perc + Woody_Wetlands_perc + Emergent_Herbaceous_Wetlands_perc +
   Deciduous_Forest_perc + Evergreen_Forest_perc + Mixed_Forest_perc +
   Shrub_perc + Grassland_perc + Pasture_perc + Cultivated_Crops_perc +
   pop_density + summer_tmmx + winter_tmmx + summer_rmax + winter_rmax

#precomputed bandwidth
bw.AIC.Fix <- 2.010529

GWPR.pFtest.resu.F <- GWPR.pFtest(formula = formula.GWPR, data = TransAirPolCalif,
                                  index = c("GEOID", "year"),
                                  SDF = California, bw = bw.AIC.Fix, adaptive = FALSE, p = 2,
                                  effect = "individual", kernel = "bisquare",
                                  longlat = FALSE)
library(tmap)
tm_shape(GWPR.pFtest.resu.F$SDF) +
     tm_polygons(col = "p.value", breaks = c(0, 0.05, 1))

GWPR.light documentation built on June 21, 2022, 5:05 p.m.