plot_effect | R 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.
plot_effect(model,sampling=TRUE,nsample=2000,nsample_max=5000,title='')
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.