data_xyplot: Plotting the response against the explanatory variables

View source: R/data_xyplot.R

data_xyplotR Documentation

Plotting the response against the explanatory variables

Description

The function data_xyplot() plots the response against all other variables in a given data set.

The function data_plot() plots all variables individually.

The function data_bucket() plots the bucket plot for all continuous variables.

The function data_zscores() calculates and plots the z-scores (obtained after fitting the SHASHo distribution) for all continuous variables.

The function y_zscores() calculates and plots the z-scores (obtained after fitting the SHASHo distribution) for a single variable.

Usage

data_xyplot(data, response, point.size = 0.5, nrow = NULL, ncol = NULL, 
          max.levels = 10, plots.per.page = 9, one.by.one = FALSE, 
          title, ...)
          
data_plot(data, value = 3, hist.col = "black", hist.fill = "white", 
           dens.fill = "#FF6666", nrow = NULL, ncol = NULL, 
           plot.hist = FALSE, plots.per.page = 9, one.by.one = FALSE, 
           title, ...) 
           
data_bucket(data, value = 3, max.levels = 20, 
           nrow = NULL, ncol = NULL, plots.per.page = 9, 
           one.by.one = FALSE, title, ...)  
           
y_zscores(x, family = SHASHo, plot = TRUE, hist = FALSE, ...)

data_zscores(data, plot.hist = TRUE, value = 3, family = SHASH,
          max.levels = 10, hist.col = "black", hist.fill = "white", 
          dens.fill = "#FF6666", nrow = NULL, ncol = NULL, 
          plots.per.page = 9, one.by.one = FALSE, title, ...)

Arguments

data

a data frame

x

a single variable

family

a gamlss distribution family (continuous)

response

the respose variable should be in the data

point.size

the size of points in scatter plots

nrow

the number of rows in the plot

ncol

the number of columns in the plot

plots.per.page

maximu plots per page

one.by.one

whether plotted individually

value

value to identify outliers if y_dots is used i.e. for upper tail an outliers is if it is greater than Q_3+value*IQ

hist.col

the colour of lines of the histogram, if plot.hist=TRUE

hist.fill

the colour of the histogram, if plot.hist=TRUE

dens.fill

the color of the density plot, if plot.hist=TRUE

plot.hist

whether to use y_dots() or y_hist() for the continuous variables

plot

whether to plot

hist

whether histiogram or dot plot

max.levels

excludes from plotting bucket plots for variables with less than max.levels, distinct values

title

title of the plot

...

other arguments

Details

The function data_xyplot() it takes a data frame and plot all the explanarory variables against the response.

The function data_plot() it takes a data frame and plot all variables against the response. The continuous are plotted using y_dots() or y_hist() while the factors and integer as bar plots.

Value

Plots of the data

Author(s)

Mikis Stasinopoulos

References

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.

Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, https://www.jstatsoft.org/v23/i07/.

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.

(see also https://www.gamlss.com/).

See Also

data_names

Examples

da <- rent99[,-2]
data_xyplot(da, rent)
data_plot(da)
y_zscores(da$rent)

gamlss.ggplots documentation built on Sept. 3, 2023, 5:08 p.m.