if (FALSE) {
# Simple example: detect 5% proportional bias with constant variance
power_result <- deming_power_sim(
n_sims = 500,
sample_size = 50,
x_range = c(10, 100),
actual_slope = 1.05,
ideal_slope = 1.0,
y_var_params = list(beta1 = 25, beta2 = 0, J = 1, type = "constant"),
x_var_params = list(beta1 = 20, beta2 = 0, J = 1, type = "constant")
)
print(power_result)
# More complex: heteroscedastic errors
power_result2 <- deming_power_sim(
n_sims = 500,
sample_size = 75,
x_range = c(1, 100),
actual_slope = 1.03,
y_var_params = list(beta1 = 0.5, beta2 = 0.05, J = 2, type = "power"),
x_var_params = list(beta1 = 0.4, beta2 = 0.04, J = 2, type = "power"),
weighted = TRUE
)
}
Run the code above in your browser using DataLab