1,525 questions
-3
votes
1
answer
114
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
360
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
133
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
87
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
80
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` ...
-5
votes
1
answer
148
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
120
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
87
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
130
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
82
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
93
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
303
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
110
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 ...
2
votes
2
answers
420
views
Finding the subarray with the least median given a size K and an array of length N
I have been struggling the past month with this problem that was given to us on our course while I was upsolving it. The task is to find the window of size K with the least median in an array of ...