Variance | R Tutorial (2024)

The variance is a numerical measure of how the data values is dispersed around themean. In particular, the sample variance is defined as:

Variance | R Tutorial (1)

Similarly, the population variance is defined in terms of the population mean μand population size N:

Variance | R Tutorial (2)

Problem

Find the sample variance of the eruption duration in the data set faithful.

Solution

We apply the var function to compute the sample variance of eruptions.

>duration=faithful$eruptions#theeruptiondurations
>var(duration)#applythevarfunction
[1]1.3027

Answer

The sample variance of the eruption duration is 1.3027.

Exercise

Find the sample variance of the eruption waiting periods in faithful.

Variance | R Tutorial (2024)
Top Articles
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 6014

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.