plot_mu: 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)
Value
A list containing the most significant \(\mu\), t-statistic, p-value, and the range of \(\mu\) for which the treatment impact is significant.
Arguments
x
A data frame containing the results from meechua_reg. Specifically, this should be the mod_coef data frame obtained from meechua_reg.
n
The original sample size (number of observations) of the data.
se_after
The estimated standard error from meechua_reg. This should be the se_after vector obtained from meechua_reg.
lower
A boolean value specifying the direction of the one-sided tests. For lower = FALSE (the default), it tests whether the intervention is increasing the measurements. For lower = TRUE, it tests whether the second measurements are lower than expected.
alpha
Specifies the significance threshold for the p-values of the corresponding one-sided tests. The default is alpha = 0.05.
Author
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.