Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctDensity

ctDensity


Description

Wrapper for base R density function that removes outliers and computes 'reasonable' bandwidth and x and y limits. Used for ctsem density plots.

Usage

ctDensity(x, bw = "auto", plot = FALSE, ...)

Arguments

x

numeric vector on which to compute density.

bw

either 'auto' or a numeric indicating bandwidth.

plot

logical to indicate whether or not to plot the output.

...

Further args to density.

Examples

y <- ctDensity(exp(rnorm(80)))
plot(y$density,xlim=y$xlim,ylim=y$ylim)

#### Compare to base defaults:
par(mfrow=c(1,2))
y=exp(rnorm(10000))
ctdens<-ctDensity(y)
plot(ctdens$density, ylim=ctdens$ylim,xlim=ctdens$xlim)
plot(density(y))

ctsem

Continuous Time Structural Equation Modelling

v3.4.3
GPL-3
Authors
Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.