公卫百科  > 所属分类  >  R/S+   
[0] 评论[0] 编辑

计算基础统计量

 Use one of these functions as appropriate, assuming that x and y are vectors:

公卫百科

 mean(x)
median(x)
 sd(x)
var(x)
 cor(x, y)
cov(x, y)
Does an NA in your data invalidate the statistic? If yes,
then  R  is  doing  the  right  thing.  If  not,  you  can  override  this  behavior  by  setting

公卫家园


na.rm=TRUE, which tells R to ignore the NA values:
> x <- c(0,1,1,2,3,NA)
> mean(x, na.rm=TRUE)
[1] 1.4
> sd(x, na.rm=TRUE)
[1] 1.140175

附件列表


0

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

如果您认为本词条还有待完善,请 编辑

上一篇 创建向量    下一篇 创建数据框

标签

同义词

暂无同义词