Table_Top_Share: Table of top shares (using three thresholds)

Description Usage Arguments Examples

View source: R/hello.R View source: R/code_package_v4_juin_2019.R View source: R/code_package_v3_juin_2019.R View source: R/code_package.r View source: R/code_package.R

Description

Table of top shares (using three thresholds)

Usage

1
2
3
4
5
6
7
Table_Top_Share(
  data,
  p = 0.01,
  q = c(0.1, 0.05, 0.01),
  md = FALSE,
  verbose = FALSE
)

Arguments

data

dataframe obtained from tidy_income function

p

numeric, the probability level (default 0.01 for the top 1%)

q

numeric (possibly a vector), the probability level to model a Pareto distribution (default c(0.1, 0.05, 0.01) for the top 10%, 5% and 1%)

md

logical TRUE to have the table in a markdown format (default is FALSE)

Examples

1
2
3
4
5
6
7
8
9
set.seed(123)
x <- rpareto1(200, 1, alpha=1.5)
w <- rgamma(200, 10, 10)
data_0  <-  tidy_income(income = x, weights = w)
Table_Top_Share(data_0,q=c(.1,.05))
url_1 <- "https://github.com/freakonometrics/TopIncome/raw/master/data_csv/dataframe_yw_1.csv"
df <- read.table(url_1,sep=";",header=TRUE)
data_1  <-  tidy_income(income = df$y, weights = df$w)
Table_Top_Share(data_1)

freakonometrics/TopIncome documentation built on Oct. 16, 2021, 5:58 p.m.