replicate_data: Replicates before and after values 100 times.

View source: R/replicate_data.R

replicate_dataR Documentation

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)

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.

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.

Value

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

Author(s)

Daniela Recchia, Thomas Ostermann.

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

rep

Examples

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

regtomean documentation built on April 4, 2025, 2:08 a.m.