## Use the three different smoothing functions and compare the results
study <- c(
"Original" = Huber2014$Berta,
"Moving median" = smooth_cases(Huber2014$Berta, method = "median"),
"Moving mean" = smooth_cases(Huber2014$Berta, method = "mean"),
"Local regression" = smooth_cases(Huber2014$Berta, method = "regression")
)
plot(study)
Huber2014$Berta |>
transform(
"compliance (moving median)" = moving_median(compliance),
"compliance (moving mean)" = moving_mean(compliance),
"compliance (local regression)" = local_regression(compliance, mt)
)
Run the code above in your browser using DataLab