plot_terms: Plot terms of non-parametric covariates in PS-SAR regression...

View source: R/plot_terms.R

plot_termsR Documentation

Plot terms of non-parametric covariates in PS-SAR regression models.

Description

For each non-parametric covariate the plot of the term includes confidence intervals and the decomposition in fixed and random part when the term is reparameterized as a mixed model.

Usage

plot_terms(fitterms, data, conflevel = 0.95)

Arguments

fitterms

object returned from fit_terms function.

data

dataframe with the data.

conflevel

numerical value for the confidence interval of the term. Default 0.95.

Value

plot of the terms for each non-parametric covariate included in the object returned from fit_terms.

Author(s)

Roman Minguez roman.minguez@uclm.es

References

  • Wood, S.N. (2017). Generalized Additive Models. An Introduction with R (second edition). CRC Press, Boca Raton.

See Also

  • fit_terms compute smooth functions for non-parametric continuous covariates.

  • plot_effects_nopar plot the effects functions of non-parametric covariates.

  • plot.gam plot the terms fitted by gam function in mgcv package.

Examples

 ###################### unemployment for 103 Italian provinces in period 1996-2014.
library(sptpsar)
data(unemp_it); Wsp <- Wsp_it
######################  No Spatial Trend: PSAR including a spatial 
######################  lag of the dependent variable
form1 <- unrate ~ partrate + agri + cons +
                 pspl(serv,nknots=15) +
                 pspl(empgrowth,nknots=20) 
 gamsar <- psar(form1,data=unemp_it,sar=TRUE,Wsp=Wsp_it)
 summary(gamsar)
 ######################  Fit non-parametric terms (spatial trend must be name "spttrend")
 list_varnopar <- c("serv","empgrowth")
 terms_nopar <- fit_terms(gamsar,list_varnopar)
 ######################  Plot non-parametric terms
 plot_terms(terms_nopar,unemp_it)
 
 @export

rominsal/sptpsar documentation built on June 1, 2022, 2:03 a.m.