plot4ratios: Draws a scatter-plot that summarizes the findings of the...

View source: R/plot4ratios.R

plot4ratiosR Documentation

Draws a scatter-plot that summarizes the findings of the Hidiroglou-Berthelot outliers' or the ratioSize detection method.

Description

The function gets the output of the function of HBmethod or ratioSize when they are ran with the argument return.dataframe = TRUE) to draw a scatter-plot of ratios vs. the corresponding importance measures.

Usage

plot4ratios(out)

Arguments

out

Is the output of HBmethod or ratioSize when they are launched with the argument return.dataframe = TRUE.

Details

This function draws a scatter-plot. With the output of HBmethod the ratios (=yt2/yt1) are on Y axis while their importance measure ( max(yt1, yt2)^U) are represented on the X axis. With the output of ratioSize on the Y axis the centered ratios are reported. In addition the acceptance bounds are drawn (blue lines); the dots (in red color) outside the bounds are the outliers. This is considered a useful diagnostic plot to understand how the procedure identifies the outliers.

Value

A scatter-plot is drawn and, in addition, the output includes a data.frame with the data used to derive the plot.

Author(s)

Marcello D'Orazio mdo.statmatch@gmail.com

References

Hidiroglou, M.A. and Berthelot, J.-M. (1986) ‘Statistical editing and Imputation for Periodic Business Surveys’. Survey Methodology, Vol 12, pp. 73-83.

Hidiroglou, M.A. and Emond, N. (2018) ‘Modifying the Hidiroglou-Berthelot (HB) method’. Unpublished note, Business Survey Methods Division, Statistics Canada, May 18 2018.

See Also

HBmethod, ratioSize

Examples

# generate some data
set.seed(222)
x0 <- rnorm(30, 50, 5)
set.seed(333)
rr <- runif(30, 0.9, 1.2)
rr[10] <- 2
x1 <- x0 * rr

# run HBmethod with argument return.dataframe = TRUE
out <- HBmethod(yt1 = x0, yt2 = x1,  
                return.dataframe = TRUE)
# draw the scatterplot
plot4ratios(out)


univOutl documentation built on May 31, 2022, 9:06 a.m.