gen_curves | R Documentation |
quantileplot
Estimate smooth curves for quantiles of the outcome as a function of the predictor. This function calls mqgam
from the qgam
package. This function is typically called indirectly via a user call to quantileplot
.
gen_curves( formula, data, weights = NULL, quantiles = c(0.1, 0.25, 0.5, 0.75, 0.9), show_ci = FALSE, credibility_level = 0.95, uncertainty_draws = 10, inverse_transformation = NULL, second_formula, argGam = NULL, ... )
formula |
A bivariate model formula (e.g. |
data |
Data frame containing the variables in |
weights |
String name for sampling weights, which are a column of |
quantiles |
Numeric vector containing quantiles to be estimated. Values should be between 0 and 1. |
show_ci |
Logical, defaults to |
credibility_level |
Numeric probability value for credible intervals; default to 0.95 to produce 95 percent credible intervals. Only relevant if |
uncertainty_draws |
A whole number. If non-null, the number of simulated posterior draws to estimate for each smooth quantile curve. When used with the |
inverse_transformation |
A function of a scalar argument. Only used in the rare use case where the outcome has an extremely skewed distribution and the user wants to estimate the quantile curves on a transformed outcome, to be brought back to the original scale for the visualization. In that case, this argument is the function to convert from the transformed outcome back to the original scale. For instance, if the outcome in the model formula is |
second_formula |
Model formula to allow the learning rate to change as a function of the predictor. This is passed to |
argGam |
Additional arguments to the GAM for model fitting. Passed to mqgam. |
... |
Other arguments passed to |
A list of length 2. Element curves
is a data frame containing the data for plotting smooth curves for quantiles of the outcome given the predictor. Element mqgam.out
is the fitted object from mqgam
.
Lundberg, Ian, Robin C. Lee, and Brandon M. Stewart. 2021. "The quantile plot: A visualization for bivariate population relationships." Working paper.
Lundberg, Ian, and Brandon M. Stewart. 2020. "Comment: Summarizing income mobility with multiple smooth quantiles instead of parameterized means." Sociological Methodology 50(1):96-111.
Fasiolo, Matteo, Simon N. Wood, Margaux Zaffran, Raphaƫl Nedellec, and Yannig Goude. 2020. "Fast calibrated additive quantile regression." Journal of the American Statistical Association.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.