Skip to content

R package for estimating correlations between censored variables

License

Notifications You must be signed in to change notification settings

SilentSpringInstitute/censcor

Repository files navigation

Travis CI status

censcor

censcor is an R package for estimating correlations between censored variables. censcor works by fitting a multivariate normal distribution to the data using Stan.

Install

devtools::install_github("silentspringinstitute/censcor", args = "--preclean")

Documentation

Documentation and vignettes for the package are available on the censcor website.

Examples

# Generate 100 x and y values with a 0.5 correlation coefficient and no censoring
df <- generate_censored_data(N = 100, rho = 0.5, L_prob = 0)

fit <- censcor(x ~ y, df)

# Fit dataset with left censoring in both x and y
df <- generate_censored_data(N = 100, rho = 0.5, L_prob = 0.5, direction = -1)

fit <- censcor(x | cens(x_cens) ~ y | cens(y_cens), df)

You can find more examples in the Introduction to censcor vignette.

About

R package for estimating correlations between censored variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published