Learn R Programming

clikcorr (version 1.0)

est: censoring data and likelihood-based correlation estimation

Description

Provides point estimation and confidence interval for the correlation coefficient.

Usage

est(data, lower1, upper1, lower2, upper2, cp = 0.95, dist = "n", df = 4, sv = NA, nlm = FALSE, ...)

Arguments

data
data frame name.
lower1
the lower bound of the first of the two variables whose correlation coefficient to be calculated.
upper1
the upper bound of the first of the two variables whose correlation coefficient to be calculated.
lower2
the lower bound of the second of the two variables whose correlation coefficient to be calculated.
upper2
the upper bound of the second of the two variables whose correlation coefficient to be calculated.
cp
confidence level for the confidence interval.
dist
working distribution. By default, dist="n" assuming the data from a bivariate normal distribution. Set dist="t" if the data are assumed generated from a bivariate t-distribution.
df
degree of freedom of the bivariate t-distribution when dist="t". By default df=4.
sv
user specified starting values for the vector of (mean1, mean2, var1, corr, var2).
nlm
use nlm as the optimization method to minimize the negative log (profile) likelihood. By default nlm=FALSE and optim is used to maximize the log (profile) likelihood.
...
not used.

Value

Cor
maximum likelihood estimate (MLE) of the correlation coefficient.
Cov
estimated variance covariance matrix.
Mean
estimated means.
LCL
lower bound of the profile confidence interval.
UCL
upper bound of the profile confidence interval.

References

Yanming Li, Kerby Shedden, Brenda W. Gillespie and John A. Gillespie (2016). Calculating Profile Likelihood Estimates of the Correlation Coefficient in the Presence of Left, Right or Interval Censoring and Missing Data.

Examples

Run this code

data(ND)
logND <- log(ND)
logND1 <- logND[51:90,]

est(logND1, "t1_OCDD", "t2_OCDD", "t1_HxCDF_234678", "t2_HxCDF_234678")

## Not run: 
# est(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD")
# 
# est(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD", dist="t",
#  nlm=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab