| plot_terms | R Documentation |
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.
plot_terms(fitterms, data, conflevel = 0.95)
fitterms |
object returned from |
data |
dataframe with the data. |
conflevel |
numerical value for the confidence interval of the term. Default 0.95. |
plot of the terms for each non-parametric covariate included
in the object returned from fit_terms.
Roman Minguez roman.minguez@uclm.es
Wood, S.N. (2017). Generalized Additive Models.
An Introduction with R (second edition). CRC Press, Boca Raton.
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.
###################### 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.