Description Usage Arguments Details Value References Examples
View source: R/plot.reg.hgld.R
Predict density plot of a Hurdle Generalized Lambda Regression.
1 2 3 4 5 |
x |
An object of class reg.hgld. |
newvalues |
A data frame with the new values of the covariates. Column names must match the ones given in formulas loc.formula and zero.formula. |
name |
A vector with the names of the new values profiles. Default is the row names of the newvalues data frame. |
color |
The color of each density curve. Must have one color for each row of newvalues. |
xlab |
Label of the x-axis. |
xlim |
A vector with the limits of the x-axis. |
title |
Legend title. |
... |
Arguments to be passed to methods. |
Given an object of class reg.hgld and new values for the covariates, returns the density function of the fitted HGLD, given the covariates. The contrast on the newvalues data frame must be same of the data used in the reg.hgld object. All density curves are plotted in the same plot.
plot |
ggplot density plot for the given new values |
Marcondes, D.; Peixoto, C.; Maia, A. C.; A Survey of a Hurdle Model for Heavy-Tailed Data Based on the Generalized Lambda Distributions. (2017) arxiv1712.02183
1 2 3 4 5 6 7 8 | set.seed(100)
tmp <- na.omit(healthcare)
data <- tmp[sample(1:nrow(tmp),50),]
formula <- log_expense ~ age + sex + log_previous_expense
reg <- suppressWarnings(reg.hgld(data = data,zero.formula = formula,loc.formula = formula,
full = FALSE,param = "rs"))
newvalues <- tmp[sample(1:nrow(tmp),5),c(2,3,5,8)]
plot(reg,newvalues)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.