+ Reply to Thread
Results 1 to 4 of 4

Combining Standard Deviations

  1. #1
    Registered User
    Join Date
    12-19-2020
    Location
    Toronto, Canada
    MS-Off Ver
    Office 365; Excel version 16.44 (20121301) for Mac
    Posts
    4

    Lightbulb Combining Standard Deviations

    Hi Everyone,

    I am looking to create a formula based on the following MathJax formula but for N = X where X is many numbers rather than just 2 means + SDs. In other words, I want to create an Excel sheet can calculate this automatically for me based on the number of populations (means + SDs) that I enter. I was trying to use sumproduct, count, and sum functios but the brackets became confusing. Essentially, my columns are as per the Excel file attached and the formula I need is also in the excel file. I know my Excel file only goes to 40 rows, but if I added more rows, I was hoping the formula would automatically adjust. The correct formula can be found at the following link under the "Combined Standard deviation:" section which can be viewed after clicking Find on the example values provided at the top: atozmath.com/CONM/Ch2_CombinedSD.aspx. Having an Excel document just makes it easier for further data analysis where I can link cells from different sheets as opposed to manually typing all of my data in online each time and this website could be unavailable too. Another thread from 2015 on here could do this, but again just for two means and SDs rather than an N that can change (excelforum.com/excel-formulas-and-functions/1106578-combine-standard-deviations.html). I attached a sample XLSX document with a screenshot of the formula for two sample means + SDs for your reference. I hope this makes some sense.

    Thanks so much!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,973

    Re: Combining Standard Deviations

    A nice empty spreadsheet....

    Please populate it with some representative data and some manually calculated expected results (for checking purposes).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Combining Standard Deviations

    [.... deleted by me ....]
    Last edited by joeu2004; 03-17-2021 at 02:03 PM.

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Combining Standard Deviations

    Quote Originally Posted by eyemdtechgeek View Post
    Another thread from 2015 on here could do this, but again just for two means and SDs rather than an N
    Actually, shg's method works for any N sets of n, mean and (population) sd. The better link is https://www.excelforum.com/excel-for...eviations.html .

    We just have to understand his presentation, namely: 12 groups of 3 sets of data each(!?).

    Thus, read across each line to see the method that could be applied to your problem.

    Also, we must use the correct method for the desired type of std dev ("population" or "sample"). See the important notes below.

    IMHO, that is not clear in the math formulas at atozmath.com. The better link is http://atozmath.com/example/CONM/Ch2...edSD.aspx?he=e .


    -----

    Applied to your design, see columns E:H in the attached file.

    Refer to the "stdevp" or "stdev" worksheet, whichever applies to you. The following refers to the "stdevp" worksheet.

    Essentially, shg's method is applied pairwise, where one of the pair is the combined n, mean and sd for the previous pair.

    Thus, the formulas in E5:H5 are dragged down their respective columns for as many studies as you have. (Four in my example.)

    (E4:H4 are simply a copy of the statistics for the first study in B4:D4.)

    A B C D E F G H
    3 study id n mean std dev comb n comb mean comb sd 1 comb sd 2
    4 1 11 50.2727 26.0353 11 50.2727 26.0353 26.0353
    5 2 13 556.2308 220.2691 24 324.3333 300.2424 300.2424
    6 3 17 5608.4118 2742.3523 41 2515.2927 3154.0324 3154.0324
    7 4 19 49015.8947 26985.2518 60 17240.4833 26557.3834 26557.3834

    HTML Code: 

    As proof of concept, see the actual combined n, mean and sd values in J2:O11 for the example study data in K13:N32.

    See the important notes in the textbox near X8. Referring to the math formulas at http://atozmath.com/example/CONM/Ch2...edSD.aspx?he=e :


    A. For Method 1, σ^2 refers to the "population" std dev (STDEVP).

    It can be coverted for the "sample" std dev (STDEV), usually denoted by s,
    by replacing σ^2 with s^2*(N-1)/N and by multiplying num/denom by (N1+N2)/(N1+N2-1).
    Algebraically, this is equivalent to:

    1. Change the numerator to: (N1-1)*s1^2 + N1*d1^2 + (N2-1)*s2^2 + N2*d2^2

    2. And change the denominator to: N1+N2-1

    Refer to the formula for G5 in the "stdev" worksheet.


    B. For Method 2, σ^2 refers to the "sample" std dev (STDEV), usually denoted by s .

    It can be converted for the "population" std dev (STDEVP) by replacing σ^2 with σ^2*N/(N-1)
    and by multiplying num/denom by (N1+N2-1)/(N1+N2). Algebraically, this is equiivalent to:

    1. Replace N1-1 with N1 and N2-1 with N2 in the numerator

    2. And replace N1+N2-1 with N1+N2 in the denominator

    3. Also, x1^2 + x2^2 - 2*x1*x2 can be simplified to (x1-x2)^2, as shg did

    Refer to the formula for H5 in the "stdevp" worksheet.

    -----

    PS.... If you do not like the idea of iterative calculations in columns E:H, we could provide a VBA function that can referenced in a single cell. I don't have time to implement that now. But would that appeal to you?
    Attached Files Attached Files
    Last edited by joeu2004; 03-17-2021 at 07:01 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Combine standard deviations
    By abousetta in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-29-2015, 04:11 PM
  2. [SOLVED] Conditional Formatting with Standard Deviations
    By ajzeleny in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2014, 11:42 AM
  3. 4 Standard Deviations
    By NathanScott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2008, 04:52 AM
  4. [SOLVED] Calculate 2 Standard Deviations
    By Michael in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2006, 01:15 PM
  5. Mean of standard deviations across columns?
    By ModelerGirl in forum Excel General
    Replies: 3
    Last Post: 02-04-2006, 01:00 PM
  6. Graph Standard Deviations
    By ed in forum Excel General
    Replies: 1
    Last Post: 08-03-2005, 05:05 PM
  7. Standard deviations in Excel
    By Fred Zack in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-14-2005, 09:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1