_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › GeometricMean

library("dplyr")
geometric.mean <- function(x){
  prop <- c(na.omit(x / dplyr::lag(x)))    
  return(exp(mean(log(prop))))
}

x <- c(1000, 1000*1.1, 1100*1.2, 1320*0.85)
geometric.mean(x)

蟆郁骸
>   geometric.mean(x)
[1] 1.039117
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2022-01-09 16:25:30

螳 谿語襷螻 企る. 覃 語企. 蠏殊蟇煙 朱 覈語 讌. 一誤 襴襦 碁襯 覿. . 覩語覃 蠍 企.