plot_mu {regtomean} | R Documentation |
Plot t-Statistics and p-Values for Intervention Impact
Description
Based on the data before and after the intervention and the regression models from the function meechua_reg
, this function plots the t-statistics and p-values for a given range of \mu
to assess whether the intervention has a significant impact on the measurements, accounting for regression to the mean.
Usage
plot_mu(x, n, se_after, lower = F, alpha = 0.05)
Arguments
x |
A data frame containing the results from |
n |
The original sample size (number of observations) of the data. |
se_after |
The estimated standard error from |
lower |
A boolean value specifying the direction of the one-sided tests. For |
alpha |
Specifies the significance threshold for the p-values of the corresponding one-sided tests. The default is |
Value
A list containing the most significant \mu
, t-statistic, p-value, and the range of \mu
for which the treatment impact is significant.
Author(s)
Julian Stein
References
Ostermann, T., Willich, S. N., & Luedtke, R. (2008). Regression toward the mean - a detection method for unknown population mean based on Mee and Chua's algorithm. BMC Medical Research Methodology.
Examples
data(language_test)
df <- replicate_data(0, 100, "Before", "After", data = language_test)
result <- meechua_reg(df)
plot_mu(result$mod_coef, n = 8, se_after = result$se_after)