gpt4 book ai didi

R : know table(s), 如何计算分位数

转载 作者:行者123 更新时间:2023-12-04 05:17:50 24 4
gpt4 key购买 nike

s 是一个大数组,只需将表保存在数据库中

> table_s
s
1 2 3 4 5
3000000 1 1 999999999999999999 34

如何使用 R 中的 table_s 计算分位数?

谢谢

最佳答案

您可以使用 Hmisc 包中的 quantile 函数,它允许使用权重。

Hmisc::wtd.quantile(as.numeric(names(table_s)),weights = table_s)

关于R : know table(s), 如何计算分位数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14027451/

24 4 0
文章推荐: asp.net-mvc-4 - MVC 4 如何有条件地添加
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com