# Calculating standard deviation without original measurements

Assume I have the monthly data for the price of items like this:

num_items = [10, 22, 13, 4, 15]

avg_cost = [200, 103, 143, 412, 123]

Now, I do not have the original list of item-wise cost table. From this, I know we can get the overall average, but Is it possible to calculate the overall standard deviation?

Assume I can also add Standard deviation and variance per month, how would I go about calculating the overall std?

• It is absolutely not possible, sorry.
– Eoin
Commented Aug 19, 2020 at 10:27
• So you do have the SD of each item group per month? If so, can you edit your question with this information as well. Commented Aug 19, 2020 at 10:31
• @user2974951 I don't have that information right now but assume I can ask for it. And this is just for illustration this is not the actual data. I could get another list std_monthly = [s1, s2, s3, s4, s5] etc. Commented Aug 19, 2020 at 11:13

Assume the months are indexed by $$r=1,..m$$, each month has $$n_r$$ observations. Denote the total deviation sum of square $$SS_T=\sum_{r=1}^m\sum_{i=1}^{n_r}(y_{ri}-\bar y)^2$$, where $$\bar y$$ is the overall sample mean, it can be proved that $$SS_T$$ can be decomposed to $${SS}_T = {SS}_A + {SS}_e$$ Where $$SS_A = \sum_r n_r(\bar y_r - \bar y)^2$$ is the between group deviation sum of square, $$SS_e = \sum_r\sum_i(y_{ri}-\bar y_r)$$ is the within group deviation sum of square.
With your current information you can only calculate $$SS_A$$, the between group deviation sum of square.
But if you can get the "variance per month", which is basically a simple transform of within group deviation sum of square $$SS_e$$, then you can sum $$SS_A$$ and $$SS_e$$ to get $$SS_T$$, and the overall sample variance will be $$\frac{SS_T}{\sum_r n_r}$$, or $$\frac{SS_T}{\sum_r n_r -1}$$.