Learn R Programming

regtomean (version 1.2)

replicate_data: Replicates before and after values 100 times.

Description

This function replicates 100 times the "before" and "after" values, given a start and end reference for the population mean (mu).

Usage

replicate_data(start, end, Before, After, data)

Value

A data frame containing the replicated dataset, which includes the columns mu, before, and after.

Arguments

start

A numeric value specifying the start value for mu.

end

A numeric value specifying the end value for mu.

Before

A numeric vector giving the data values for the first ("before") measurement.

After

A numeric vector giving the data values for the second ("after") measurement.

data

An optional data frame containing the Before and After variables. If not provided, the Before and After vectors must be supplied directly.

Author

Daniela Recchia, Thomas Ostermann.

Details

To overcome the limitations of Mee and Chua's test regarding the population mean (mu), this function performs a replication of the data over a specified range of values.

The replicated data is used for systematically estimating the unknown population mean (mu). Further analyses are based on this new dataset.

References

Ostermann, T., Willich, Stefan N., & Luedtke, Rainer. (2008). Regression toward the mean - a detection method for unknown population mean based on Mee and Chua's algorithm. BMC Medical Research Methodology.

Galton, F. (1886). Regression towards mediocrity in hereditary stature. Journal of the Anthropological Institute (15: 246-263).

See Also

Examples

Run this code
# Example usage of replicate_data
replicate_data(0, 100, "Before", "After", data = language_test)

Run the code above in your browser using DataLab