logLik.psar | R Documentation |
Extract method log-likelihood or restricted log-likelihood from objects of class psar.
## S3 method for class 'psar' logLik(object, REML = FALSE, ...)
object |
object of class psar. |
REML |
logical value indicating if the log-likelihood is restricted. Default: FALSE. |
... |
further arguments passed to or from other methods. |
An object of class logLik. Apart from the log-likelihood (or restricted log-likelihood) value, this object has some additional attributes:
nall | Whole number of observations. |
nobs | Effective number of observations. |
df | Effective degrees of freedom. |
coef.psar
Extract vector of coefficients for
fitted psar objects including fixed and random effects.
################################################ ###################### Examples using a panel data of rate of ###################### unemployment for 103 Italian provinces in period 1996-2014. library(sptpsar) data(unemp_it); Wsp <- Wsp_it ###################### GAM pure 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) llik_gamsar <- logLik(gamsar) llikreml_gamsar <- logLik(gamsar, REML = TRUE) cat("Log-Likelihood: ",llik_gamsar,"\n") cat("Restricted Log-Likelihood: ",llikreml_gamsar,"\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.