Title: | Quantile Regression Quasi-Cauchy |
---|---|
Description: | Quasi-Cauchy quantile regression, proposed by de Oliveira, Ospina, Leiva, Figueroa-Zuniga and Castro (2023) <doi:10.3390/fractalfract7090667>. This regression model is useful for the case where you want to model data of a nature limited to the intervals [0,1], (0,1], [0,1) or (0,1) and you want to use a quantile approach. |
Authors: | Jose Sergio Case de Oliveira [aut, cre] |
Maintainer: | Jose Sergio Case de Oliveira <[email protected]> |
License: | GPL-3 |
Version: | 1.0 |
Built: | 2025-03-13 03:30:08 UTC |
Source: | https://github.com/cran/qcauchyreg |
Democratization index from "The Quality of Government Basic Dataset” of the University of Gothenburg.
data("Democratization")
data("Democratization")
A data frame containing 138 observations on 4 variables.
democratization
democratization index of 138 countries, which can take values in [0, 1].
gdp
real gross domestic product per capita in thousands of dollars.
schooling
average schooling (in years) of people aged 25 years or more.
press_freedom
press freedom index of 138 countries. A lower value indicating greater press freedom, while a higher value indicates limited press freedom.
The data set was collected by "The Quality of Government Basic Dataset” of the University of Gothenburg. The data refers to 138 countries observed in 2010. The dependent variable is the democratization index (democratization
), which takes values between 0 and 1 . The closer to 1, the greater the democratization. The explanatory variables are real gross domestic product per capita in thousands of dollars (gdp
), average schooling (in years) of people aged 25 years or more (schooling
) and press freedom index (press_freedom
), a lower value indicating greater press freedom, while a higher value indicates limited press freedom.
https://www.gu.se/en/quality-government/qog-data/data-downloads/basic-dataset
de Oliveira, J.S.C.; Ospina, R.; Leiva, V.; Figueroa-Zuniga, J.; Castro, C. (2023). Quasi-Cauchy Regression Modeling for Fractiles Based on Data Supported in the Unit Interval. Fractal Fract. 7, 667. doi:10.3390/fractalfract7090667
data("Democratization", package = "qcauchyreg") ## de Oliveira, J.S.C.; Ospina, R.; Leiva, V.; Figueroa-Zuniga, J.; Castro, C. (2023) fit <- qcreg(democratization ~ schooling + press_freedom, data = Democratization, npi=50) summary(fit) fit$effects plot(fit$pis, type="l") plot(fit$quantregplot)
data("Democratization", package = "qcauchyreg") ## de Oliveira, J.S.C.; Ospina, R.; Leiva, V.; Figueroa-Zuniga, J.; Castro, C. (2023) fit <- qcreg(democratization ~ schooling + press_freedom, data = Democratization, npi=50) summary(fit) fit$effects plot(fit$pis, type="l") plot(fit$quantregplot)
Percentage of extremely poor, by Brazilian municipality for the year 2010. Data made available by http://www.atlasbrasil.org.br/.
data("Poverty")
data("Poverty")
A data frame containing 5501 observations on 4 variables.
poverty
Percentage of extremely poor, by Brazilian municipality for the year 2010.
population
Total municipal population in 2010, in thousands.
illiteracy
Municipal illiteracy rate of people aged 15 or over, in 2010.
pc_income
Municipal per capita income (in Brazilian reais), in 2010.
The dataset is available at http://www.atlasbrasil.org.br/. The data refer to 5501 Brazilian municipalities observed in 2010. The dependent variable is the percentage of people in extreme poverty (poverty
). Naturally, it is a limited variable that takes values in the unit range. The explanatory variables are total population in thousands of people (population
), illiteracy rate of people aged 15 or over (illiteracy
) and per capita income in Brazilian reais (pc_income
). Municipalities with missing information on any of the variables were excluded from the sample.
http://www.atlasbrasil.org.br/
data("Poverty", package = "qcauchyreg") reg <- qcreg(poverty ~ population + illiteracy + pc_income, data = Poverty, npi=50) summary(reg) reg$effects plot(reg$pis, type="l") plot(reg$quantregplot)
data("Poverty", package = "qcauchyreg") reg <- qcreg(poverty ~ population + illiteracy + pc_income, data = Poverty, npi=50) summary(reg) reg$effects plot(reg$pis, type="l") plot(reg$quantregplot)
Returns an object of class rq()
that represents a Quasi-Cauchy quantile regression fit. Quasi-Cauchy quantile regression is useful when you want to perform quantile regression analysis on data limited to the unit range.
qcreg(formula, data, tau=0.5, npi=100, criterion="bic", tau_i=0.05, tau_f=0.95)
qcreg(formula, data, tau=0.5, npi=100, criterion="bic", tau_i=0.05, tau_f=0.95)
formula |
a formula object, with the response on the left of a ~ operator, and the terms, separated by + operators, on the right. |
data |
a |
tau |
the quantile to be estimated, this is a number strictly between 0 and 1. The default value is 0.5. |
npi |
(optional) the number of Pi's that will be considered for choosing the Pi that best fits the model. The default value is 100. |
criterion |
(optional) criterion to decide the Pi that fits the model. Choose "aic" for AIC, "bic" for BIC and "R2" for pseudo-R2. Or, indicate a numerical value between 0<Pi<pi to use a particular Pi. The default is the automatic choice of Pi following the BIC criterion. |
tau_i |
(optional) if you want to estimate several quantiles simultaneously, enter the lower limit of the range of coatis you want to estimate here. The default value is 0.05. |
tau_f |
(optional) if you want to estimate several quantiles simultaneously, enter the upper limit of the range of coatis you want to estimate here. The default value is 0.95. |
The Quasi-Cauchy quantile regression model is based on the traditional quantile model, proposed by Koenker (2005) (doi:10.1017/CBO9780511754098), to which the Quasi-Cauchy link function is added, allowing the estimation of quantile regression when modeling a variable of nature limited to the ranges [0,1], (0,1], [0,1) or (0,1). For more details on Quasi-Cauchy quantile regression, see de Oliveira, Ospina, Leiva, Figueroa-Zuniga and Castro (2023) (doi:10.3390/fractalfract7090667).
qcreg()
returns an object of class rq()
, hence all outputs of an rq()
object are accessible.
index
returns the Pi value used in estimating the model and 4 goodness-of-fit criteria, namely: AIC, BIC, pseudo-R2, adjusted pseudo-R2.
effects
returns the marginal effect on the average.
quantregplot
returns argument for graphical visualization of estimates (and confidence intervals) considering a range of values for tau instead of a single value.
pis
returns the values of Pi considered in the procedure for choosing the ideal Pi, as well as the corresponding goodness-of-fit criterion values. Available only when Pi is chosen via goodness-of-fit criteria.
Jose Sergio Case de Oliveira
[1] Koenker, R. W. (2005). Quantile Regression, Cambridge U. Press. doi:10.1017/CBO9780511754098
[2] de Oliveira, J.S.C.; Ospina, R.; Leiva, V.; Figueroa-Zuniga, J.; Castro, C. (2023). Quasi-Cauchy Regression Modeling for Fractiles Based on Data Supported in the Unit Interval. Fractal Fract. 7, 667. doi:10.3390/fractalfract7090667
data("Democratization", package = "qcauchyreg") fit <- qcreg(democratization ~ schooling + press_freedom, data = Democratization, criterion=1) summary(fit) fit$effects fit$index data("Poverty", package = "qcauchyreg") fit2 <- qcreg(poverty ~ population + illiteracy + pc_income, data = Poverty, npi=50, criterion="bic") summary(fit2) fit2$effects fit2$index plot(fit2$pis, type="l") plot(fit2$quantregplot)
data("Democratization", package = "qcauchyreg") fit <- qcreg(democratization ~ schooling + press_freedom, data = Democratization, criterion=1) summary(fit) fit$effects fit$index data("Poverty", package = "qcauchyreg") fit2 <- qcreg(poverty ~ population + illiteracy + pc_income, data = Poverty, npi=50, criterion="bic") summary(fit2) fit2$effects fit2$index plot(fit2$pis, type="l") plot(fit2$quantregplot)