Learn R Programming

NNS (version 0.5.6)

NNS.PDF: NNS PDF

Description

This function generates an empirical PDF using dy.dx on NNS.CDF.

Usage

NNS.PDF(variable, degree = 1, target = NULL, bins = NULL, plot = TRUE)

Arguments

variable

a numeric vector.

degree

integer; (degree = 0) is frequency, (degree = 1) (default) is area.

target

a numeric range of values [a,b] where a < b. NULL (default) uses the variable min and max observations respectively.

bins

integer; NULL Selects number of bins. Bin width defaults to density(x)$bw.

plot

logical; plots PDF.

Value

Returns a data.table containing the intervals used and resulting PDF of the variable.

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" https://www.amazon.com/dp/1490523995/ref=cm_sw_su_dp

Examples

Run this code
# NOT RUN {
set.seed(123)
x <- rnorm(100)
NNS.PDF(x)

## Custom target range
NNS.PDF(x, target = c(-5, 5))
# }

Run the code above in your browser using DataLab