Compute how much the one percent wealthier concentrates using survey data [closed]

好久不见. 提交于 2019-12-14 03:27:07

问题


I would like to compute in R how much the one percent wealthier concentrates. For example, maybe it is the case that the one percent wealthier concentrates 33% of total wealth in the country.

I have a survey dataset with the variables:

  • asset: Value of total assets for each individual (row);
  • wgt : Sample weight associated with each individual (row).

What is the best way to compute this concentration measure?

Thanks a lot!


回答1:


welcome to SO. please don't be discouraged by the downvoters, i think your question is perfectly reasonable. let's say your survey design object is scf.design .. that way, you could try a test case using the 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 )


来源:https://stackoverflow.com/questions/24587499/compute-how-much-the-one-percent-wealthier-concentrates-using-survey-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!