Title: | The L-Logistic Bayesian Regression |
Version: | 1.0.0 |
Date: | 2019-03-06 |
Author: | Sara Alexandre Fonsêca [aut], Rosineide Fernando da Paz [aut, cre], Jorge Luís Bazán [ctb] |
Maintainer: | Rosineide Fernando da Paz <rfpaz2@gmail.com> |
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. |
Imports: | llogistic, rstan, MCMCpack, MASS, coda, stats |
Depends: | R (≥ 3.4.0), ggplot2 (≥ 2.0.0), StanHeaders (≥ 2.18.0), Rcpp (≥ 0.12.0) |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.0 |
NeedsCompilation: | no |
Packaged: | 2019-04-02 22:08:18 UTC; Sara |
Repository: | CRAN |
Date/Publication: | 2019-04-04 16:20:03 UTC |
The L-Logistic Bayesian Regression
Description
Bayesian L-Logistic regression package, <URL:https://www.imstat.org/wp-content/uploads/2018/05/BJPS397.pdf>.
Details
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 |
Author(s)
Sara Alexandre Fonsêca saralexandre@alu.ufc.br, Rosineide Fernando da Paz rfpaz2@gmail.com, Jorge Luís Bazán
Source
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.
References
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.
Education Development Index
Description
EDI data set is the Education Development Index (EDI), Elementary School and High School of the municipalities of Sergipe state of Brazil.
Usage
data("EDI")
Format
A data frame containing 75 observations on 2 variables.
- EDIES
The format is: num [1:75] 3.6 3.6 3.8 3.1 3.5 3.7 3.8 3 3.2 0 ...
- EDIHS
The format is: num [1:75] 3.8 2.9 3 2.8 2.8 1.9 3 2.2 2.6 3.6 ...
Details
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.
References
Fundação Lemann e Meritt (2012): portal QEdu.org.br, acessado em 10/01/2019.
Examples
data(EDI)
## maybe str(EDI) ; plot(EDI) ...
Municipal Human Development Index
Description
MHDI data set is the Municipal Human Development Index (MHDI) of the municipalities of Sergipe state of Brazil.
Usage
data("MHDI")
Format
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 ...
Details
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.
Source
PNUD, IPEA \& FJP. (2013).
References
PNUD, IPEA & FJP. (2013). Atlas do Desenvolvimento Humano no Brasil. PNUD, Brasilia, Brazil. Disponible in: http://www.atlasbrasil.org.br/2013/pt/.
Examples
data(MHDI)
## maybe str(MHDI) ; plot(MHDI) ...
Data of the votes in the presidential elections of the municipalities of Sergipe in the years 1994, 1998, 2002 and 2006
Description
Proportion of votes for a political party (Partido dos Trabalhadores) in presidential elections in Brazil by the different municipalities of Sergipe state.
Usage
data("Votes")
Format
A data frame containing 75 observations on 4 variables.
- Votes1994
The format is: num [1:75] 0.228 0.172 0.431 0.105 0.165 ...
- Votes1998
The format is: num [1:75] 0.293 0.193 0.427 0.111 0.155 ...
- Votes2002
The format is: num [1:75] 0.307 0.278 0.517 0.268 0.223 ...
- Votes2006
The format is: num [1:75] 0.492 0.365 0.375 0.426 0.368 ...
Details
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.
References
Tribunal Superior Eleitoral. Reposit?rio de Dados Eleitorais: TSE website www.tse.jus.br, accessed 10/01/2018.
Examples
data(Votes)
## maybe str(Votes) ; plot(Votes) ...
Highest Posterior Density for the L-Logistic Bayesian Regression
Description
Compute the highest posterior density for the L-Logistic Bayesian Regression intervals of betas and deltas.
Usage
llHPD(fitll, prob = 0.95, chain = 1)
Arguments
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. |
Details
This function compute the highest posterior density intervals for a Bayesian posterior distribution.
Value
Object of class matrix with:
betas |
The highest posterior density intervals of betas. |
deltas |
The highest posterior density intervals of deltas. |
Author(s)
Sara Alexandre Fonsêca saralexandre@alu.ufc.br, Rosineide Fernando da Paz rfpaz2@gmail.com, Jorge Luís Bazán
Source
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.
References
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.
Examples
# 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)
The L-Logistic Bayesian Regression
Description
Function to estimate a L-Logistic regression model with median and precision regression structures.
Usage
llbayesireg(y,X,W,niter=1000,chains=1,burn=floor(niter/2),jump=1)
Arguments
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. |
Details
See https://cran.r-project.org/web/packages/llogistic/llogistic.pdf.
Value
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. |
Author(s)
Sara Alexandre Fonsêca saralexandre@alu.ufc.br, Rosineide Fernando da Paz rfpaz2@gmail.com, Jorge Luís Bazán
Source
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.
References
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.
Examples
# 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")
Diagnostics from a fitll object
Description
Prints diagnostics or extract those diagnostics from a fitll object.
Usage
lldiagnostics(object)
Arguments
object |
Object of "fitll". |
Details
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.
Value
lldiagnostics(object) prints diagnostics or extract those diagnostics from a fitll object.
Author(s)
Sara Alexandre Fonsêca saralexandre@alu.ufc.br, Rosineide Fernando da Paz rfpaz2@gmail.com, Jorge Luís Bazán
Source
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.
References
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.
Examples
# 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)