I have a column with mostly decimal numbers and some integers
Example (the integers are in bold). – Y = [1 0.098 0.00076 0.01 2 0.099 0.007 2 0.003 0.04 0.1 4]. The integers range from 1 – 4.
I want to find the average of the numbers in between the integers, essentially [1 mean(0.098 0.00076 0.01) 2 mean (0.099 0.007) 2 mean(0.003 0.04 0.1) 4].
What would be the best way to do this? Is it recommended I turn the integers into a grouping variable?
Best Answer