Title: | The L-Logistic Bayesian Regression |
---|---|
Description: | R functions and data sets for the work Paz, R.F., Balakrishnan, N and Bazán, J.L. (2018). L-logistic regression models: Prior sensitivity analysis, robustness to outliers and applications. Brazilian Journal of Probability and Statistics, <https://www.imstat.org/wp-content/uploads/2018/05/BJPS397.pdf>. |
Authors: | Sara Alexandre Fonsêca [aut], Rosineide Fernando da Paz [aut, cre], Jorge Luís Bazán [ctb] |
Maintainer: | Rosineide Fernando da Paz <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2025-02-25 06:02:24 UTC |
Source: | https://github.com/cran/llbayesireg |
Bayesian L-Logistic regression package, <URL:https://www.imstat.org/wp-content/uploads/2018/05/BJPS397.pdf>.
Package to estimate an L-Logistic regression model with median and precision regression structures, diagnostics and HPD.
Package: | llbayesireg |
Type: | Package |
Version: | 0.1.0 |
Date: | 2019-03-06 |
License: | GPL-3 |
LazyLoad: | yes |
Sara Alexandre Fonsêca [email protected], Rosineide Fernando da Paz [email protected], Jorge Luís Bazán
The L-Losgistic distribution was introduced by Tadikamalla and Johnson (1982), which refer to this distribution as Logit-Logistic distribution. Here, we have a new parameterization of the Logit-Logistic with the median as a parameter.
Paz, R.F., Balakrishnan, N and Bazán, J.L. (2018). L-Logistic Distribution: Properties, Inference and an Application to Study Poverty and Inequality in Brazil.
EDI data set is the Education Development Index (EDI), Elementary School and High School of the municipalities of Sergipe state of Brazil.
data("EDI")
data("EDI")
A data frame containing 75 observations on 2 variables.
The format is: num [1:75] 3.6 3.6 3.8 3.1 3.5 3.7 3.8 3 3.2 0 ...
The format is: num [1:75] 3.8 2.9 3 2.8 2.8 1.9 3 2.2 2.6 3.6 ...
The quality of education is attributed by a statistical value to educational indicators. This value is assigned by the context economic and social development to which the schools are inserted, not only by the students' performances. The systems educational use mainly of them for the monitoring of educational quality.
Fundação Lemann e Meritt (2012): portal QEdu.org.br, acessado em 10/01/2019.
data(EDI) ## maybe str(EDI) ; plot(EDI) ...
data(EDI) ## maybe str(EDI) ; plot(EDI) ...
Function to estimate a L-Logistic regression model with median and precision regression structures.
llbayesireg(y,X,W,niter=1000,chains=1,burn=floor(niter/2),jump=1)
llbayesireg(y,X,W,niter=1000,chains=1,burn=floor(niter/2),jump=1)
y |
Object of class vector, with the response. |
X |
Object of class matrix, with the variables for modelling the meadian. The default is NULL. |
W |
Object of class matrix, with the variables for modelling the presision. The default is NULL. |
niter |
A positive integer specifying the number of iterations for each chain. The default is 1000. |
chains |
A positive integer specifying the number of Markov chains. The default is 1. |
burn |
A positive integer specifying the period sampling (known as the burn-in). The default is niter/2. |
jump |
A positive integer specifying the period for saving samples. The default is 1. |
See https://cran.r-project.org/web/packages/llogistic/llogistic.pdf.
Object of the class matrix, if the user does not provide arguments X and W, with:
object |
Object of "fitll". |
betas |
Object of class matrix with the samples of regression coeficient related to median. |
deltas |
Object of class matrix with the samples of regression coeficient related to precision parameter. |
sample.m |
Object of class matrix with the samples of median. |
sample.phi |
Object of class matrix with the samples of precision parameter. |
Object of the class matrix, if the user provide arguments X and W, with:
object |
Object of "fitll". |
betas |
Object of class matrix with the samples of regression coeficient related to median. |
deltas |
Object of class matrix with the samples of regression coeficient related to precision parameter. |
sample.m |
Object of class matrix with the samples of median. |
sample.phi |
Object of class matrix with the samples of precision parameter. |
pred |
Object of class matrix with predicte vaules. |
q |
The number of columns of X. |
d |
The number of columns of W. |
Sara Alexandre Fonsêca [email protected], Rosineide Fernando da Paz [email protected], Jorge Luís Bazán
The L-Losgistic distribution was introduced by Tadikamalla and Johnson (1982), which refer to this distribution as Logit-Logistic distribution. Here, we have a new parameterization of the Logit-Logistic with the median as a parameter.
Paz, R.F., Balakrishnan, N and Bazán, J.L. (2018). L-Logistic Distribution: Properties, Inference and an Application to Study Poverty and Inequality in Brazil.
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) m.hat=mean(fitll$sample.m); m.hat phi.hat=mean(fitll$sample.phi); phi.hat # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) summary(fitll$object, pars = c("beta","delta"), probs = c(0.025,0.975)) plot(fitll$betas[,1,1], type = "l")
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) m.hat=mean(fitll$sample.m); m.hat phi.hat=mean(fitll$sample.phi); phi.hat # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) summary(fitll$object, pars = c("beta","delta"), probs = c(0.025,0.975)) plot(fitll$betas[,1,1], type = "l")
Prints diagnostics or extract those diagnostics from a fitll object.
lldiagnostics(object)
lldiagnostics(object)
object |
Object of "fitll". |
The function calls the check_* functions and the get_* functions are for access to the diagnostics. If the matrix X and W are missing, the coda package is used by test the convergence of the chains by Cramer-von-Mises statistic and an image of the correlation is show for both of generated chains.
lldiagnostics(object) prints diagnostics or extract those diagnostics from a fitll object.
Sara Alexandre Fonsêca [email protected], Rosineide Fernando da Paz [email protected], Jorge Luís Bazán
The L-Losgistic distribution was introduced by Tadikamalla and Johnson (1982), which refer to this distribution as Logit-Logistic distribution. Here, we have a new parameterization of the Logit-Logistic with the median as a parameter.
Paz, R.F., Balakrishnan, N and Bazán, J.L. (2018). L-Logistic Distribution: Properties, Inference and an Application to Study Poverty and Inequality in Brazil. The Stan Development Team Stan Modeling Language User's Guide and Reference Manual. http://mc-stan.org/. Plummer, M., Best, N., Cowles, K., and Vines, K. (2006). Coda: Convergence diagnosis and output analysis for mcmc. R News, 6(1):7-11.
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) lldiagnostics(fitll$object) # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) lldiagnostics(fitll$object)
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) lldiagnostics(fitll$object) # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) lldiagnostics(fitll$object)
Compute the highest posterior density for the L-Logistic Bayesian Regression intervals of betas and deltas.
llHPD(fitll, prob = 0.95, chain = 1)
llHPD(fitll, prob = 0.95, chain = 1)
fitll |
Object of class matrix with the llbayesireg function result. |
prob |
A number of quantiles of interest. The default is 0.95. |
chain |
Chain chosen for construction. The default is 1. |
This function compute the highest posterior density intervals for a Bayesian posterior distribution.
Object of class matrix with:
betas |
The highest posterior density intervals of betas. |
deltas |
The highest posterior density intervals of deltas. |
Sara Alexandre Fonsêca [email protected], Rosineide Fernando da Paz [email protected], Jorge Luís Bazán
The L-Losgistic distribution was introduced by Tadikamalla and Johnson (1982), which refer to this distribution as Logit-Logistic distribution. Here, we have a new parameterization of the Logit-Logistic with the median as a parameter.
Paz, R.F., Balakrishnan, N and Bazán, J.L. (2018). L-Logistic Distribution: Properties, Inference and an Application to Study Poverty and Inequality in Brazil.
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) llHPD(fitll) # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) llHPD(fitll)
# Modelation the coeficient with generated data library(llbayesireg) library(llogistic) # Number of elements to be generated n=50 # Generated response bin=2005 set.seed(bin) y=rllogistic(n,0.5, 2) fitll = llbayesireg(y, niter=100, jump=10) llHPD(fitll) # Modelation the coeficient with real data library(llbayesireg) data("Votes","MHDI") y = Votes[,4] X = MHDI fitll = llbayesireg(y,X) llHPD(fitll)
MHDI data set is the Municipal Human Development Index (MHDI) of the municipalities of Sergipe state of Brazil.
data("MHDI")
data("MHDI")
The format is: num [1:75] 0.611 0.578 0.77 0.595 0.579 0.649 0.604 0.54 0.621 0.569 ...
The MHDI is a summary measure of long-term progress in three basic dimensions of human development that takes into account education, income and longevity indexes in municipalities. The MHDI data is the geometric mean of normalized indexes for each of the three dimensions of human development.
PNUD, IPEA \& FJP. (2013).
PNUD, IPEA & FJP. (2013). Atlas do Desenvolvimento Humano no Brasil. PNUD, Brasilia, Brazil. Disponible in: http://www.atlasbrasil.org.br/2013/pt/.
data(MHDI) ## maybe str(MHDI) ; plot(MHDI) ...
data(MHDI) ## maybe str(MHDI) ; plot(MHDI) ...
Proportion of votes for a political party (Partido dos Trabalhadores) in presidential elections in Brazil by the different municipalities of Sergipe state.
data("Votes")
data("Votes")
A data frame containing 75 observations on 4 variables.
The format is: num [1:75] 0.228 0.172 0.431 0.105 0.165 ...
The format is: num [1:75] 0.293 0.193 0.427 0.111 0.155 ...
The format is: num [1:75] 0.307 0.278 0.517 0.268 0.223 ...
The format is: num [1:75] 0.492 0.365 0.375 0.426 0.368 ...
Proportion of votes for a political party (Partido dos Trabalhadores) in presidential elections in Brazil by the different municipalities of Sergipe state in the years 1994, 1998, 2002 and 2006.
Tribunal Superior Eleitoral. Reposit?rio de Dados Eleitorais: TSE website www.tse.jus.br, accessed 10/01/2018.
data(Votes) ## maybe str(Votes) ; plot(Votes) ...
data(Votes) ## maybe str(Votes) ; plot(Votes) ...