0

"The Hodges-Lehmann estimator is the median of the combined data points and Walsh averages". In my data I have the data points before and after. I understand that the Hodges-Lehman estimator gives me a median of these data points combined. Am I correct? And how should this be coded? This try results in the error "unused argument (after = NULL)"

df %>% HodgesLehmann(before, after = NULL, conf.level = NA, na.rm = FALSE)

My data

structure(list(condition = c(2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 
                                      2, 2, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 
                                      2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 
                                      1, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 
                                      2, 1), before = c(13, 7, 18, 18, 15, 5, 14, 5, 3, 6, 
                                                        18, 7, 5, 11, 6, 3, NA, 3, 11, 8, 10, 3, 7, 7, 12, 3, 5, 8, 4, 
                                                        9, 15, 9, 3, 16, 3, 3, 11, 3, 11, 8, 14, 21, 21, 17, 9, 3, 18, 
                                                        15, 6, 6, 12, 9, 15, 5, 13, 7, 6, 7, 9, 11, 21, 12, 7, 12, 6, 
                                                        21, 15, 21, 16, 12, 7, 18, 12, 20, 3, 10), after = c(15, 
                                                                                                             3, 6, 18, 14, 15, 6, NA, 6, 3, 18, NA, 3, 15, NA, 15, 11, NA, 
                                                                                                             10, 9, NA, 6, 6, 12, 3, NA, NA, 11, 9, 15, 21, 21, 6, 15, 9, 
                                                                                                             16, 9, 11, 14, 13, 5, NA, 3, 10, NA, 3, 18, 12, NA, NA, 8, 11, 
                                                                                                             14, NA, 13, NA, NA, 10, 6, 5, 15, 11, 12, NA, 5, NA, 15, 21, 
                                                                                                             11, NA, 3, NA, 12, NA, 17, 15)), class = c("rowwise_df", "tbl_df", 
                                                                                                                                                        "tbl", "data.frame"), row.names = c(NA, -76L), groups = structure(list(
                                                                                                                                                          .rows = structure(list(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 
                                                                                                                                                                                 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 
                                                                                                                                                                                 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 
                                                                                                                                                                                 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 
                                                                                                                                                                                 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 
                                                                                                                                                                                 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 
                                                                                                                                                                                 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 
                                                                                                                                                                                 76L), ptype = integer(0), class = c("vctrs_list_of", 
                                                                                                                                                                                                                     "vctrs_vctr", "list"))), row.names = c(NA, -76L), class = c("tbl_df", 
                                                                                                                                                                                                                                                                                 "tbl", "data.frame")))
Gato
  • 389
  • 2
  • 12

0 Answers0