Weighted empirical cumulative distribution function (data frame version)

Fhat_df_(.data, x, weights)

Arguments

.data

a data frame

x

name of the numeric column (as character)

weights

name of the weight column (as character)

Value

a data frame with columns: x, wcum and Fhat

Examples

data(invented_wages)
Fhat_df_(invented_wages, "wage", "sample_weights")
#> # A tibble: 90 × 4
#>     wage  wsum  wcum     Fhat
#>    <dbl> <dbl> <dbl>    <dbl>
#>  1  2000    34    34 0.000484
#>  2  2100   514   548 0.00781 
#>  3  2200    86   634 0.00903 
#>  4  2300  1084  1718 0.0245  
#>  5  2400   955  2673 0.0381  
#>  6  2500   723  3396 0.0484  
#>  7  2600  1166  4562 0.0650  
#>  8  2700  1029  5591 0.0796  
#>  9  2800  1277  6868 0.0978  
#> 10  2900  2326  9194 0.131   
#> # ℹ 80 more rows