plot_effect: plot_effect plot_effect is a function that plots the effect...

View source: R/plot_effect.R

plot_effectR Documentation

plot_effect plot_effect is a function that plots the effect of a variable X_k with spatially varying coefficient, i.e X_k * Beta_k(u_i,v_i) for comparing the magnitude of effects of between variables.

Description

plot_effect plot_effect is a function that plots the effect of a variable X_k with spatially varying coefficient, i.e X_k * Beta_k(u_i,v_i) for comparing the magnitude of effects of between variables.

Usage

plot_effect(model,sampling=TRUE,nsample=2000,nsample_max=5000,title='')

Arguments

model

a model of mgwrsar class with some spatially varying coefficients.

sampling

Bolean, if nrow(model$Betav)> nsample_max a sample of size nsample is randomly selected, default TRUE.

nsample

integer, size of the sample if sampling is TRUE, default 2000.

nsample_max

integer, size max to engage sampling if sampling is TRUE, default 5000.

title

a title for the plot.

Examples


 library(mgwrsar)
 ## loading data example
 data(mydata)
 coord=as.matrix(mydata[,c("x_lat","y_lon")])
 ## Creating a spatial weight matrix (sparce dgCMatrix)
 ## of 8 nearest neighbors with 0 in diagonal
 model_GWR0<-MGWRSAR(formula = 'Y_gwr~X1+X2+X3', data = mydata,coord=coord,
 fixed_vars=NULL,kernels=c('gauss'),H=0.13, Model = 'GWR',control=list(SE=TRUE))
 plot_effect(model_GWR0)


mgwrsar documentation built on April 17, 2023, 9:09 a.m.