9.1 C
London
Friday, December 20, 2024
HomeRHypothesis Tests in RHow to Calculate Pooled Variance in R

How to Calculate Pooled Variance in R

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

In statistics, pooled variance refers to the average of two or more group variances.

We use the word “pooled” to indicate that we’re “pooling” two or more group variances to come up with a single number for the common variance between the groups.

In practice, pooled variance is used most often in a two sample t-test, which is used to determine whether or not two population means are equal.

The pooled variance between two samples is typically denoted as sp2 and is calculated as:

sp2 = ( (n1-1)s12 + (n2-1)s22  )  /  (n1+n2-2)

Unfortunately there is no built-in function to calculate the pooled variance between two groups in R, but we can calculate it fairly easily.

For example, suppose we want to calculate the pooled variance between the following two groups:

The following code shows how to calculate the pooled variance between these groups in R:

#define groups of data
x1 #calculate sample size of each group
n1 #calculate sample variance of each group
var1 #calculate pooled variance between the two groups
pooled #display pooled variance
pooled

[1] 46.97143

The pooled variance between these two groups turns out to be 46.97143.

Additional Resources

What is Pooled Variance? (Definition & Example)
Pooled Variance Calculator
How to Calculate Pooled Variance in Excel

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories