Learn R Programming

bda (version 1.2.7-31)

rounding: Data rounding.

Description

To bin raw data and prepare data for finite mixture model fitting.

Usage

rounding(x, scale=1, method='nearest')

Arguments

x
Sample data before rounding.
scale
The scale of data. Default: scale=1.
method
Method to round the data: up/down, or to the nearest integers.

Details

Raw data need to be prepared to have specific formats to be analyzed using the FMMBD functions. In summary, data should have three columns: x = center of the bins, widths = width of the bins, and counts = counts (frequencies) of the bins.

If data are prepared manually, default scale=1. One may need to transform data first.

References

Wang, B. and Wertelecki, W. (2012) Density Estimation for Data With Rounding Errors. Computational Statistics and Data Analysis, (in press), doi: 10.1016/j.csda.2012.02.016.

See Also

bfmm

Examples

Run this code
data(birth)
(ofc = rounding(birth$Head))
(bwt = rounding(birth$Weight, scale=100))

Run the code above in your browser using DataLab