【问题标题】:Compute how much the one percent wealthier concentrates using survey data [closed]使用调查数据计算 1% 的富人集中了多少
【发布时间】:2014-07-05 14:40:32
【问题描述】:

我想在 R 中计算 1% 的富人集中了多少。例如,也许是 1% 的富人集中了该国总财富的 33%。

我有一个包含变量的调查数据集:

  • asset:每个人的总资产值(行);
  • wgt :与每个个体(行)相关的样本重量。

计算此浓度度量的最佳方法是什么?

非常感谢!

【问题讨论】:

  • 嗯,你们都对他太苛刻了。 :) 对于我们这些熟悉 survey 包的人来说,这个问题有一个非常简单的程序化答案

标签: r survey


【解决方案1】:

欢迎来到 SO。请不要被反对者气馁,我认为你的问题是完全合理的。假设您的调查设计对象是 scf.design .. 这样,您可以使用 survey of consumer finances 尝试测试用例

# compute the cutoff point for the top percentile
y <- coef( svyquantile( ~ asset , scf.design , 0.99 ) )
# for this, you probably don't need the standard error, 
# so immediately just extract the coefficient (the actual number)
# and discard the standard error term by using the `coef` function
# around the `svyquantile` call

# create a new flag in your survey design object
# that's a 1 if the individual is in the top percentile
# and a 0 for everybody else
scf.design <- update( scf.design , onepct = as.numeric( asset > y ) )

# calculate the aggregate of all assets
# held by the top percentile
# and also held by everybody else
svyby( ~asset , ~onepct , scf.design , svytotal )

# or, if you like, calculate them separately
svytotal( ~asset , subset( scf.design , onepct == 1 ) )

svytotal( ~asset , subset( scf.design , onepct == 0 ) )

# and divide each of those numbers by all assets
# held by everybody
svytotal( ~asset , scf.design )

【讨论】:

  • 谢谢安东尼!我是向您发送有关 SCF 基尼系数的电子邮件的人。我会试试你的解决方案。
  • 完美运行!再次感谢!
猜你喜欢
  • 2019-10-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-11
  • 2020-07-28
  • 2020-04-09
相关资源
最近更新 更多