Calculate Harmonic Mean in R (Example) | Vector & Data Frame Column | harmonic.mean of psych Package

Опубликовано: 30 Апрель 2022
на канале: Statistics Globe
666
12

How to compute the harmonic mean in the R programming language. More details: https://statisticsglobe.com/harmonic-...
R code of this video:

x <- c(10, 14, 29, 30, 41, 53, 27, 55) # Create example vector
x # Print example vector

install.packages("psych") # Install psych package
library("psych") # Load psych package

harmonic.mean(x) # Apply harmonic.mean function

data(iris) # Load iris data
head(iris) # First rows of iris data

harmonic.mean(iris$Sepal.Length) # Apply harmonic.mean to column

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – Group for Discussions & Questions:   / statisticsglobe  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – Group for Discussions & Questions:   / 12555223  
Twitter:   / joachimschork  

Music by bensound.com