Learn R Programming

regtomean (version 1.2)

meechua_eff.CI: Calculates and plots treatment and regression effects as also its p-values.

Description

This function calculates and plots treatment and regression effects of both before and after measures as also its p-values.

Usage

meechua_eff.CI(x,n,se_after)

Value

Two plots are performed, the first "Treatment Effect and p-value" and the second "Confidence Intervals" for mu.

Arguments

x

a data frame containing the results from meechua_reg. It is stored as mod_coef.

n

the original sample size (number of observations) from data.

se_after

the estimated standard error from meechua_reg. It is stored as se_after.

Author

Daniela Recchia, Thomas Ostermann

Details

After performing the meechua_reg the model coefficients mod_coef as also its global variable se_after are used as input in this function to estimate treatment and regression effects.

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.

See Also

meechua_reg

Examples

Run this code
# Initialize environment explicitly
#regtomean_env <- new.env(parent = emptyenv())

# Generate example data
language_test <- data.frame(
  Before = rnorm(100, mean = 50, sd = 10),
  After = rnorm(100, mean = 55, sd = 10)
)

# Replicate data
mee_chua <- replicate_data(0, 100, "Before", "After", data = language_test)
mee_chua <- mee_chua[order(mee_chua$mu), ]

# Perform regression analysis and store results
results <- meechua_reg(mee_chua)
mod_coef <- results$mod_coef
se_after <- results$se_after

# Call meechua_eff.CI
meechua_eff.CI(mod_coef, 100, se_after)

Run the code above in your browser using DataLab