1,527 questions
-3 votes
1 answer
99 views
VBA calculation of Maximum, minimum, Mean and Median for values in a column [closed]
For reasons unknown, the Application.WorksheetFunction procedures do not work on my Excel and so I am trying to do these calculations using VBA. I have written a sub routine for these calculations but ...
2 votes
3 answers
310 views
Faster moving median in numpy
I am trying to calculate a moving median for around 10.000 signals that each are a list of length around 750. An example dataframe looks like this: num_indices = 2000 # Set number of indices # ...
0 votes
2 answers
128 views
Function that calculates rolling MAD while ignoring outlier values [closed]
I am trying to write a function to compute the rolling Median Absolute Deviation (MAD) for outlier detection in a time series dataset. The goal is to: Detect outliers based on a rolling MAD algorithm ...
1 vote
1 answer
79 views
Median with a sliding window
The goal is to use MEDIAN as a window function with a sliding window of a specific size. SELECT *, MEDIAN(n) OVER(ORDER BY id ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) FROM test_data ORDER BY id;...
0 votes
1 answer
74 views
MariaDB messes up median when using agregate function
I've noticed that MariaDB messes up the median calculation if you try to get the median and an aggregate function on same query I created a simple example test my theory CREATE TABLE `test` ( `a` ...
0 votes
0 answers
17 views
Alternative solution that optimizes Geometric Median with the same reliability as brute force
The most common approach to obtain Geometric Median is to use the Weiszfeld's algorithm or a variant: it is good, but may fail to converge when one of its estimates falls on one of the given points. ...
-5 votes
1 answer
147 views
Calculating median value [closed]
I have a text file containing thousands of lines, a single numeric value on each line. Values are between -2.5 - 2.5, single decimal. I am using this line to give me the lowest value, highest value, ...
1 vote
0 answers
104 views
What is a good approach to calculate the median of weighted data using SQL?
TL;DR: I've got a column for test metric, for control metric, and for test-control weight. I can use the weight to calculate a weighted average. How should I approach median metrics in a SQL ...
1 vote
2 answers
81 views
Excel: How to calculate Median while excluding matching data from another column
I am trying to calculate the median time while excluding a certain data. I have 3 columns of data. I need to calculate the Column B but exclude times where column A & C match. Column A Column B ...
1 vote
1 answer
127 views
Median calculation over windows - rangeBetween over months in pyspark databricks
I am working in databricks pyspark and I am trying to get the median over the last two months excluding the current month. Also, there are multiple accounts so this must be parttioned but account too. ...
0 votes
1 answer
65 views
R ggplot() plot whole dataframe and sort by median
My aim is to make a plot like that: I don't want relative imporantces, I just want to plot each column in my dataframe as a boxplot and sort them by median. I don't have groups or anything else I ...
2 votes
1 answer
89 views
How to calculate median using lag/lead in R
I would like to calculate consecutive two-month medians of the chla variable in this dataset. I created an ID key (ID = current month, ID2 = the consecutive month) to help with the calculation. I ...
0 votes
2 answers
282 views
Bootstrapping Two Medians with "boot" function in R
I am trying to implement the Bootstrapping Two Medians procedure either in R or in Matlab, by following the procedure described in that article: Bootstrap each sample separately, creating the ...
0 votes
1 answer
40 views
gtsummary::tbl_summary gives different flavours of tables
I am using gtsummary::tbl_summary on R4.4. I received a table for it using the following df: structure(list(Treatment = c("Verum", "Verum", "SoC", "SoC", "...
4 votes
1 answer
104 views
How to do a weighted median test for two samples in R? [closed]
I have two samples (Group 1 and Group 2), each containing 1) an income variable and 2) a weight variable indicating the weight for each observation. I simply want to test whether the medians of income ...