densfun: Estimate the derivative of the cdf function using kernel...

Description Usage Arguments Value Author(s) Examples

View source: R/all_funs.R

Description

computes the derivative of a function in a point using kernel estimation

Usage

1
densfun(formula, design, x, h = NULL, FUN = "F", na.rm = FALSE, ...)

Arguments

formula

a formula specifying the income variable

design

a design object of class survey.design from the survey library.

x

the point where the derivative is calculated

h

value of the bandwidth based on the whole sample

FUN

if F estimates the derivative of the cdf function; if big_s estimates the derivative of total in the tails of the distribution

na.rm

Should cases with missing values be dropped?

...

future expansion

Value

the value of the derivative at x

Author(s)

Djalma Pessoa and Anthony Damico

Examples

1
2
3
4
5
6
7
8
9
library(laeken)
data(eusilc) ; names( eusilc ) <- tolower( names( eusilc ) )
library(survey)
des_eusilc <- svydesign(ids = ~rb030, strata =~db040,  weights = ~rb050, data = eusilc)
des_eusilc <- convey_prep( des_eusilc )
densfun (~eqincome, design=des_eusilc, 10000, FUN="F" )
# linearized design using a variable with missings
densfun ( ~ py010n , design = des_eusilc, 10000, FUN="F" )
densfun ( ~ py010n , design = des_eusilc , 10000,FUN="F", na.rm = TRUE )

convey documentation built on July 1, 2020, 11:44 p.m.