Different Theil-Sen Slope Estimator p-values

Hello all,

I'm trying to do some trend analysis using a Theil-Sen slope estimator. Currently, I've seen two methods using the Theil-Sen function from the (amazing) open-air package, and using the mblm package. When I run the functions, they show virtually the same slope, but for whatever reason, they show completely different p-values and y-intercepts, which change the intrepetation of the results. It seems clear to me that the p-value and intercept are being calculated differently between the two functions, but I can't find in the code that would lead to such a signicant difference. Any ideas where this difference could be?

Openair Version

TheilSen(filter(LWCLoadingData, Year > 2008 & Year < 2018), pollutant = "TOCMass", date.format = "%Y", avg.time = "year", statistic = "median")

slope = 8.362
intercept = -189.6

Using the MBLM package

  filter(Year < 2018 & Year > 2008)%>%
  summarise(across(where(is.numeric), median, na.rm = TRUE))

MedianMBLM<-mblm(TOCMass~Year, dataframe = MedianTrends, repeated = FALSE)

slope = 8.369
intercept = -16675.723

The Theil-Sen and dplyr code are using the exact same median values, so the differences don' seem to be there. Any help would be appreciated here.

See the FAQ: How to do a minimal reproducible example reprex for beginners. Reverse engineering an issue deters answers.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.