Distribution diagnostics, transformations, and probability plots

This vignette explains probability plots, plotting positions, goodness-of-fit tests, and Box-Cox transformations. Complete and censored samples are treated together so that the assumptions and extensions of each diagnostic can be compared.

Related vignettes:

qqPlot

Help topic: qqPlot.

If y is not supplied, the vector x is assumed to be a sample from the probability distribution specified by the argument distribution (and param.list if estimate.params=FALSE). When plot.type="Q-Q", the quantiles of x are plotted on the \(y\)-axis against the quantiles of the assumed distribution on the \(x\)-axis.

If y is supplied and plot.type="Q-Q", the empirical quantiles of y are plotted against the empirical quantiles of x.

When plot.type="Tukey Mean-Difference Q-Q", the difference of the quantiles is plotted on the \(y\)-axis against the mean of the quantiles on the \(x\)-axis.

Special Distributions
When y is not supplied and the argument distribution specifies one of the following distributions, the function qqPlot behaves in the manner described below.

Explanation of Q-Q Plots
A probability plot or quantile-quantile (Q-Q) plot is a graphical display invented by Wilk and Gnanadesikan (1968) to compare a data set to a particular probability distribution or to compare it to another data set. The idea is that if two population distributions are exactly the same, then they have the same quantiles (percentiles), so a plot of the quantiles for the first distribution vs. the quantiles for the second distribution will fall on the 0-1 line (i.e., the straight line \(y = x\) with intercept 0 and slope 1). If the two distributions have the same shape and spread but different locations, then the plot of the quantiles will fall on the line \(y = x + b\) (parallel to the 0-1 line) where \(b\) denotes the difference in locations. If the distributions have different locations and differ by a multiplicative constant \(m\), then the plot of the quantiles will fall on the line \(y = mx + b\) (D’Agostino, 1986a, p. 25; Helsel and Hirsch, 1986, p. 42). Various kinds of differences between distributions will yield various kinds of deviations from a straight line.

Comparing Observations to a Hypothesized Distribution
Let \(\underline{x} = x_1, x_2, \ldots, x_n\) denote the observations in a random sample of size \(n\) from some unknown distribution with cumulative distribution function \(F()\), and let \(x_{(1)}, x_{(2)}, \ldots, x_{(n)}\) denote the ordered observations. Depending on the particular formula used for the empirical cdf (see ecdfPlot), the \(i\)’th order statistic is an estimate of the \(i/(n+1)\)’th, \((i-0.5)/n\)’th, etc., quantile. For the moment, assume the \(i\)’th order statistic is an estimate of the \(i/(n+1)\)’th quantile, that is:

\[\hat{F}[x_{(i)}] = \hat{p}_i = \frac{i}{n+1} \;\;\;\;\;\; (1)\]

so

\[x_{(i)} \approx F^{-1}(\hat{p}_i) \;\;\;\;\;\; (2)\]

If we knew the form of the true cdf \(F\), then the plot of \(x_{(i)}\) vs. \(F^{-1}(\hat{p}_i)\) would form approximately a straight line based on Equation (2) above. A probability plot is a plot of \(x_{(i)}\) vs. \(F_0^{-1}(\hat{p}_i)\), where \(F_0\) denotes the cdf associated with the hypothesized distribution. The probability plot should fall roughly on the line \(y=x\) if \(F=F_0\). If \(F\) and \(F_0\) merely differ by a shift in location and scale, that is, if \(F[(x - \mu) / \sigma] = F_0(x)\), then the plot should fall roughly on the line \(y = \sigma x + \mu\).

The quantity \(\hat{p}_i = i/(n+1)\) in Equation (1) above is called the plotting position for the probability plot. This particular formula for the plotting position is appealing because it can be shown that for any continuous distribution

\[E\{F[x_{(i)}]\} = \frac{i}{n+1} \;\;\;\;\;\; (3)\]

(Nelson, 1982, pp. 299-300; Stedinger et al., 1993). That is, the \(i\)’th plotting position defined as in Equation (1) is the expected value of the true cdf evaluated at the \(i\)’th order statistic. Many authors and practitioners, however, prefer to use a plotting position that satisfies:

\[F^{-1}(\hat{p}_i) = E[x_{(i)}] \;\;\;\;\;\; (4)\]

or one that satisfies

\[F^{-1}(\hat{p}_i) = M[x_{(i)}] = F^{-1}\{M[u_{(i)}]\} \;\;\;\;\;\; (5)\]

where \(M[x_{(i)}]\) denotes the median of the distribution of the \(i\)’th order statistic, and \(u_{(i)}\) denotes the \(i\)’th order statistic in a random sample of \(n\) uniform (0,1) random variates.

The plotting positions in Equation (4) are often approximated since the expected value of the \(i\)’th order statistic is often difficult and time-consuming to compute. Note that these plotting positions will differ for different distributions.

The plotting positions in Equation (5) were recommended by Filliben (1975) because they require computing or approximating only the medians of uniform (0,1) order statistics, no matter what the form of the assumed cdf \(F_0\). Also, the median may be preferred as a measure of central tendency because the distributions of most order statistics are skewed.

Most plotting positions can be written as:

\[\hat{p}_i = \frac{i - a}{n - 2a + 1} \;\;\;\;\;\; (6)\]

where \(0 \le a \le 1\) (D’Agostino, 1986a, p.25; Stedinger et al., 1993). The quantity \(a\) is sometimes called the “plotting position constant”, and is determined by the argument plot.pos.con in the function qqPlot. The table below, adapted from Stedinger et al. (1993), displays commonly used plotting positions based on equation (6) for several distributions.

    Distribution  
    Often Used  
Name a With References
Weibull 0 Weibull, Weibull (1939),
    Uniform Stedinger et al. (1993)
Median 0.3175 Several Filliben (1975),
      Vogel (1986)
Blom 0.375 Normal Blom (1958),
    and Others Looney and Gulledge (1985)
Cunnane 0.4 Several Cunnane (1978),
      Chowdhury et al. (1991)
Gringorten 0.44 Gumbel Gringorton (1963),
      Vogel (1986)
Hazen 0.5 Several Hazen (1914),
      Chambers et al. (1983),
      Cleveland (1993)

For moderate and large sample sizes, there is very little difference in visual appearance of the Q-Q plot for different choices of plotting positions.

Comparing Two Data Sets
Let \(\underline{x} = x_1, x_2, \ldots, x_n\) denote the observations in a random sample of size \(n\) from some unknown distribution with cumulative distribution function \(F()\), and let \(x_{(1)}, x_{(2)}, \ldots, x_{(n)}\) denote the ordered observations. Similarly, let \(\underline{y} = y_1, y_2, \ldots, y_m\) denote the observations in a random sample of size \(m\) from some unknown distribution with cumulative distribution function \(G()\), and let \(y_{(1)}, y_{(2)}, \ldots, y_{(m)}\) denote the ordered observations. Suppose we are interested in investigating whether the shape of the distribution with cdf \(F\) is the same as the shape of the distribution with cdf \(G\) (e.g., \(F\) and \(G\) may both be normal distributions but differ in mean and standard deviation).

When \(n = m\), we can visually explore this question by plotting \(y_{(i)}\) vs. \(x_{(i)}\), for \(i = 1, 2, \ldots, n\). The values in \(\underline{y}\) are spread out in a certain way depending on the true distribution: they may be more or less symmetric about some value (the population mean or median) or they may be skewed to the right or left; they may be concentrated close to the mean or median (platykurtic) or there may be several observations “far away” from the mean or median on either side (leptokurtic). Similarly, the values in \(\underline{x}\) are spread out in a certain way. If the values in \(\underline{x}\) and \(\underline{y}\) are spread out in the same way, then the plot of \(y_{(i)}\) vs. \(x_{(i)}\) will be approximately a straight line. If the cdf \(F\) is exactly the same as the cdf \(G\), then the plot of \(y_{(i)}\) vs. \(x_{(i)}\) will fall roughly on the straight line \(y = x\). If \(F\) and \(G\) differ by a shift in location and scale, that is, if \(F[(x-\mu)/\sigma] = G(x)\), then the plot will fall roughly on the line \(y = \sigma x + \mu\).

When \(n > m\), a slight adjustment has to be made to produce the plot. Let \(\hat{p}_1, \hat{p}_2, \ldots, \hat{p}_m\) denote the plotting positions corresponding to the \(m\) empirical quantiles for the \(y\)’s and let \(\hat{p}^*_1, \hat{p}^*_2, \ldots, \hat{p}^*_n\) denote the plotting positions corresponding the \(n\) empirical quantiles for the \(x\)’s. Then we plot \(y_{(j)}\) vs. \(x^*_{(j)}\) for \(j = 1, 2, \ldots, m\) where

\[x^*_{(j)} = (1 - r) x_{(i)} + r x_{(i+1)} \;\;\;\;\;\; (7)\]

\[r = \frac{\hat{p}_j - \hat{p}^*_i}{\hat{p}^*_{i+1} - \hat{p}^*_i} \;\;\;\;\;\; (8)\]

\[\hat{p}^*_i \le \hat{p}_j \le \hat{p}^*_{i+1} \;\;\;\;\;\; (9)\]

That is, the values for the \(x^*_{(j)}\)’s are determined by linear interpolation based on the values of the plotting positions for \(\underline{x}\) and \(\underline{y}\).

A similar adjustment is made when \(n < m\).

Note that the R function qqplot uses a different method than the one in Equation (7) above; it uses linear interpolation based on 1:n and m by calling the approx function.

gofTest

Help topic: gofTest.

ppointsCensored

Help topic: ppointsCensored.

Methods for computing plotting positions for complete data sets (no censored observations) are discussed in D’Agostino, R.B. (1986a) and Cleveland (1993). For data sets with censored observations, these methods must be modified. The function ppointsCensored allows you to compute plotting positions based on any of the following methods:

Let \(\underline{x}\) denote a random sample of \(N\) observations from some distribution. Assume \(n\) (\(0 < n < N\)) of these observations are known and \(c\) (\(c=N-n\)) of these observations are all censored below (left-censored) or all censored above (right-censored) at \(k\) fixed censoring levels

\[T_1, T_2, \ldots, T_K; \; K \ge 1 \;\;\;\;\;\; (1)\]

For the case when \(K \ge 2\), the data are said to be Type I multiply censored. For the case when \(K=1\), set \(T = T_1\). If the data are left-censored and all \(n\) known observations are greater than or equal to \(T\), or if the data are right-censored and all \(n\) known observations are less than or equal to \(T\), then the data are said to be Type I singly censored (Nelson, 1982, p.7), otherwise they are considered to be Type I multiply censored.

Let \(c_j\) denote the number of observations censored below or above censoring level \(T_j\) for \(j = 1, 2, \ldots, K\), so that

\[\sum_{i=1}^K c_j = c \;\;\;\;\;\; (2)\]

Let \(x_{(1)}, x_{(2)}, \ldots, x_{(N)}\) denote the “ordered” observations, where now “observation” means either the actual observation (for uncensored observations) or the censoring level (for censored observations). For right-censored data, if a censored observation has the same value as an uncensored one, the uncensored observation should be placed first. For left-censored data, if a censored observation has the same value as an uncensored one, the censored observation should be placed first.

Note that in this case the quantity \(x_{(i)}\) does not necessarily represent the \(i\)’th “largest” observation from the (unknown) complete sample.

Finally, let \(\Omega\) (omega) denote the set of \(n\) subscripts in the “ordered” sample that correspond to uncensored observations.

Product-Limit Method of Kaplan and Meier (prob.method="kaplan-meier")
For complete data sets (no censored observations), the empirical probabilities estimator of the cumulative distribution function evaluated at the \(i\)’th ordered observation is given by (D’Agostino, 1986a, p.8):

\[\hat{F}[x_{(i)}] = \hat{p}_i = \frac{\#[x_j \le x_{(i)}]}{n} \;\;\;\;\;\; (3)\]

where \(\#[x_j \le x_{(i)}]\) denotes the number of observations less than or equal to \(x_{(i)}\) (see the help file for ecdfPlot). Kaplan and Meier (1958) extended this method of computing the empirical cdf to the case of right-censored data.

Right-Censored Data (censoring.side="right")
Let \(S(t)\) denote the survival function evaluated at \(t\), that is:

\[S(t) = 1 - F(t) = Pr(X > t) \;\;\;\;\;\; (4)\]

Kaplan and Meier (1958) show that a nonparametric estimate of the survival function at the \(i\)’th ordered observation that is not censored (i.e., \(i \in \Omega\)), is given by:

\(\hat{S}[x_{(i)}]\) \(=\) \(\widehat{Pr}[X > x_{(i)}]\)
  \(=\) \(\widehat{Pr}[X > x_{(1)}]\)
    \(\;\; \widehat{Pr}[X > x_{(2)} | X > x_{(1)}] \;\; \cdots\)
    \(\;\; \widehat{Pr}[X > x_{(i)} | X > x_{(i-1)}]\)
  \(=\) \(\prod_{j \in \Omega, j \le i} \frac{n_j - d_j}{n_j}, \;\; i \in \Omega \;\;\;\;\; (5)\)

where \(n_j\) is the number of observations (uncensored or censored) with values greater than or equal to \(x_{(j)}\), and \(d_j\) denotes the number of uncensored observations exactly equal to \(x_{(j)}\) (if there are no tied uncensored observations then \(d_j\) will equal 1 for all values of \(j\)). (See also Lee and Wang, 2003, pp. 64–69; Michael and Schucany, 1986). By convention, the estimate of the survival function at a censored observation is set equal to the estimated value of the survival function at the largest uncensored observation less than or equal to that censoring level. If there are no uncensored observations less than or equal to a particular censoring level, the estimate of the survival function is set to 1 for that censoring level.

Thus the Kaplan-Meier plotting position at the \(i\)’th ordered observation that is not censored (i.e., \(i \in \Omega\)), is given by:

\[\hat{p}_i = \hat{F}[x_{(i)}] = 1 - \prod_{j \in \Omega, j \le i} \frac{n_j - d_j}{n_j} \;\;\;\;\;\; (6)\]

The plotting position for a censored observation is set equal to the plotting position associated with the largest uncensored observation less than or equal to that censoring level. If there are no uncensored observations less than or equal to a particular censoring level, the plotting position is set to 0 for that censoring level.

As an example, consider the following right-censored data set:

\[3, \ge4, \ge4, 5, 5, 6\]

The table below shows how the plotting positions are computed.

\(i\) \(x_{(i)}\) \(n_i\) \(d_i\) \(\frac{n_i-d_i}{n_i}\) Plotting Position
1 \(3\) \(6\) \(1\) \(5/6\) \(1 - (5/6) = 0.167\)
2 \(\ge4\)        
3 \(\ge4\)        
4 \(5\) \(3\) \(2\) \(1/3\) \(1 - (5/6)(1/3) = 0.722\)
5 \(5\)       \(0.722\)
6 \(6\) \(1\) \(1\) \(0/1\) \(1 - (5/6)(1/3)(0/1) = 1\)

Note that for complete data sets, Equation (6) reduces to Equation (3).

Left-Censored Data (censoring.side="left")
Gillespie et al. (2010) give formulas for the Kaplan-Meier estimator for the case of left-cesoring (censoring.side="left"). In this case, the plotting position for the \(i\)’th ordered observation, assuming it is not censored, is computed as:

\[\hat{p}_i = \hat{F}[x_{(i)}] = \prod_{j \in \Omega, j > i} \frac{n_j - d_j}{n_j} \;\;\;\;\;\; (7)\]

where \(n_j\) is the number of observations (uncensored or censored) with values less than or equal to \(x_{(j)}\), and \(d_j\) denotes the number of uncensored observations exactly equal to \(x_{(j)}\) (if there are no tied uncensored observations then \(d_j\) will equal 1 for all values of \(j\)). The plotting position is equal to 1 for the largest uncensored order statistic.

As an example, consider the following left-censored data set:

\[3, <4, <4, 5, 5, 6\]

The table below shows how the plotting positions are computed.

\(i\) \(x_{(i)}\) \(n_i\) \(d_i\) \(\frac{n_i-d_i}{n_i}\) Plotting Position
1 \(3\) \(1\) \(1\) \(0/1\) \(1(5/6)(3/5) = 0.5\)
2 \(<4\)        
3 \(<4\)        
4 \(5\) \(5\) \(2\) \(3/5\) \(0.833\)
5 \(5\)       \(1(5/6) = 0.833\)
6 \(6\) \(6\) \(1\) \(5/6\) \(1\)

Note that for complete data sets, Equation (7) reduces to Equation (3).

Modified Kaplan-Meier Method (prob.method="modified kaplan-meier")
(Left-Censored Data Only.) For left-censored data, the modified Kaplan-Meier method is the same as the Kaplan-Meier method, except that for the largest uncensored order statistic, the plotting position is not set to 1 but rather is set equal to the Blom plotting position: \((N - 0.375)/(N + 0.25)\). This method is useful, for example, when creating Quantile-Quantile plots.

Hazard Plotting Method of Nelson (prob.method="nelson")
(Right-Censored Data Only.) For right-censored data, Equation (5) can be re-written as:

\[\hat{S}[x_{(i)}] = \prod_{j \in \Omega, j \le i} \frac{N-j}{N-j+1}, \;\; i \in \Omega \;\;\;\;\;\; (8)\]

Nelson (1972) proposed the following formula for plotting positions for the uncensored observations in the context of estimating the hazard function (see Michael and Schucany,1986, p.469):

\[\hat{p}_i = \hat{F}[x_{(i)}] = 1 - \prod_{j \in \Omega, j \le i} exp(\frac{-1}{N-j+1}) \;\;\;\;\;\; (9)\]

See Lee and Wang (2003) for more information about the hazard function.

As for the Kaplan and Meier (1958) method, the plotting position for a censored observation is set equal to the plotting position associated with the largest uncensored observation less than or equal to that censoring level. If there are no uncensored observations less than or equal to a particular censoring level, the plotting position is set to 0 for that censoring level.

Generalization of Product-Limit Method, Michael and Schucany
(prob.method="michael-schucany")
For complete data sets, the disadvantage of using Equation (3) above to define plotting positions is that it implies the largest observed value is the maximum possible value of the distribution (the \(100\)’th percentile). This may be satisfactory if the underlying distribution is known to be discrete, but it is usually not satisfactory if the underlying distribution is known to be continuous.

A more frequently used formula for plotting positions for complete data sets is given by:

\[\hat{F}[x_{(i)}] = \hat{p}_i = \frac{i - a}{N - 2a + 1} \;\;\;\;\;\; (10)\]

where \(0 \le a \le 1\) (Cleveland, 1993, p. 18; D’Agostino, 1986a, pp. 8,25). The value of \(a\) is usually chosen so that the plotting positions are approximately unbiased (i.e., approximate the mean of their distribution) or else approximate the median value of their distribution (see the help file for ecdfPlot). Michael and Schucany (1986) extended this method for both left- and right-censored data sets.

Right-Censored Data (censoring.side="right")
For right-censored data sets, the plotting positions for the uncensored observations are computed as:

\[\hat{p}_i = 1 - \frac{N-a+1}{N-2a+1} \prod_{j \in \Omega, j \le i} \frac{N-j-a+1}{N-j-a+2} \;\; i \in \Omega \;\;\;\;\;\; (11)\]

Note that the plotting positions proposed by Herd (1960) and Johnson (1964) are a special case of Equation (11) with \(a=0\). Equation (11) reduces to Equation (10) in the case of complete data sets. Note that unlike the Kaplan-Meier method, plotting positions associated with tied uncensored observations are not the same (just as in the case for complete data using Equation (10)).

As for the Kaplan and Meier (1958) method, for right-censored data the plotting position for a censored observation is set equal to the plotting position associated with the largest uncensored observation less than or equal to that censoring level. If there are no uncensored observations less than or equal to a particular censoring level, the plotting position is set to 0 for that censoring level.

Left-Censored Data (censoring.side="left")
For left-censored data sets the plotting positions are computed as:

\[\hat{p}_i = \frac{N-a+1}{N-2a+1} \prod_{j \in \Omega, j \ge i} \frac{j-a}{j-a+1} \;\; i \in \Omega \;\;\;\;\;\; (12)\]

Equation (12) reduces to Equation (10) in the case of complete data sets. Note that unlike the Kaplan-Meier method, plotting positions associated with tied uncensored observations are not the same (just as in the case for complete data using Equation (10)).

For left-censored data, the plotting position for a censored observation is set equal to the plotting position associated with the smallest uncensored observation greater than or equal to that censoring level. If there are no uncensored observations greater than or equal to a particular censoring level, the plotting position is set to 1 for that censoring level.

Generalization of Product-Limit Method, Hirsch and Stedinger
(prob.method="hirsch-stedinger")
Hirsch and Stedinger (1987) use a slightly different approach than Kaplan and Meier (1958) and Michael and Schucany (1986) to derive a nonparametric estimate of the survival function (probability of exceedance) in the context of left-censored data. First they estimate the value of the survival function at each of the censoring levels. The value of the survival function for an uncensored observation between two adjacent censoring levels is then computed by linear interpolation (in the form of a plotting position). See also Helsel and Cohn (1988).

The discussion below presents an extension of the method of Hirsch and Stedinger (1987) to the case of right-censored data, and then presents the original derivation due to Hirsch and Stedinger (1987) for left-censored data.

Right-Censored Data (censoring.side="right")
For right-censored data, the survival function is estimated as follows. For the \(j\)’th censoring level (\(j = 0, 1, \ldots, K\)), write the value of the survival function as:

\(S(T_j)\) \(=\) \(Pr[X > T_j]\)
  \(=\) \(Pr[X > T_{j+1}] + Pr[T_j < X \le T_{j+1}]\)
  \(=\) \(S(T_{j+1}) + Pr[T_j < X \le T_{j+1} | X > T_j] Pr[X > T_j]\)
  \(=\) \(S(T_{j+1}) + Pr[T_j < X \le T_{j+1} | X > T_j] S(T_j) \;\;\;\;\;\; (13)\)

where

\[T_0 = -\infty, \;\;\;\;\;\; (14)\]

\[T_{K+1} = \infty \;\;\;\;\;\; (15)\]

Now set

\(A_j\) \(=\) # uncensored observations in \((T_j, T_{j+1}] \;\;\;\;\;\; (16)\)
\(B_j\) \(=\) # observations in \((T_{j+1}, \infty) \;\;\;\;\;\; (17)\)

for \(j = 0, 1, \ldots, K\). Then the method of moments estimator of the conditional probability in Equation (13) is given by:

\[\widehat{Pr}[T_j < X \le T_{j+1} | X > T_j] = \frac{A_j}{A_j + B_j} \;\;\;\;\;\; (18)\]

Hence, by equations (13) and (18) we have

\[\hat{S}(T_j) = \hat{S}(T_{j+1}) + (\frac{A_j}{A_j + B_j}) \hat{S}(T_{j}) \;\;\;\;\;\; (19)\]

which can be rewritten as:

\[\hat{S}(T_{j+1}) = \hat{S}(T_j) [1 - (\frac{A_j}{A_j + B_j})] \;\;\;\;\;\; (20)\]

Equation (20) can be solved interatively for \(j = 1, 2, \ldots, K\). Note that

\[\hat{S}(T_0) = \hat{S}(-\infty) = S(-\infty) = 1 \;\;\;\;\;\; (21)\]

\[\hat{S}(T_{K+1}) = \hat{S}(\infty) = S(\infty) = 0 \;\;\;\;\;\; (22)\]

Once the values of the survival function at the censoring levels are computed, the plotting positions for the \(A_j\) uncensored observations in the interval \((T_J, T_{j+1}]\) (\(j = 0, 1, \ldots, K\)) are computed as

\[\hat{p}_i = [1 - \hat{S}(T_j)] + [\hat{S}(T_j) - \hat{S}(T_{j+1})] \frac{r-a}{A_j - 2a + 1} \;\;\;\;\;\; (23)\]

where \(a\) denotes the plotting position constant, \(0 \le a \le 1\), and \(r\) denotes the rank of the \(i\)’th observation among the \(A_j\) uncensored observations in the interval \((T_J, T_{j+1}]\). (Tied observations are given distinct ranks.)

For the \(c_j\) observations censored at censoring level \(T_j\) (\(j = 1, 2, \ldots, K\)), the plotting positions are computed as:

\[\hat{p}_i = 1 - [\hat{S}(T_j) \frac{r-a}{c_j - 2a + 1}] \;\;\;\;\;\; (24)\]

where \(r\) denotes the rank of the \(i\)’th observation among the \(c_j\) observations censored at censoring level \(T_j\). Note that all the observations censored at the same censoring level are given distinct ranks, even though there is no way to distinguish between them.

Left-Censored Data (censoring.side="left")
For left-censored data, Hirsch and Stedinger (1987) modify the definition of the survival function as follows:

\[S^*(t) = Pr[X \ge t] \;\;\;\;\;\; (25)\]

For continuous distributions, the functions in Equations (4) and (25) are identical.

Hirsch and Stedinger (1987) show that for the \(j\)’th censoring level (\(j = 0, 1, \ldots, K\)), the value of the survival function can be written as:

\(S(T_j)\) \(=\) \(Pr[X \ge T_j]\)
  \(=\) \(Pr[X \ge T_{j+1}] + Pr[T_j \le X < T_{j+1}]\)
  \(=\) \(S^*(T_{j+1}) + Pr[T_j \le X < T_{j+1} | X < T_{j+1}] Pr[X < T_{j+1}]\)
  \(=\) \(S^*(T_{j+1}) + Pr[T_j \le X < T_{j+1} | X < T_j] [1 - S^*(T_j)] \;\;\;\;\;\; (26)\)

where \(T_0\) and \(T_{K+1}\) are defined in Equations (14) and (15).

Now set

\(A_j\) \(=\) # uncensored observations in \([T_j, T_{j+1}) \;\;\;\;\;\; (27)\)
\(B_j\) \(=\) # observations in \((-\infty, T_j) \;\;\;\;\;\; (28)\)

for \(j = 0, 1, \ldots, K\). Then the method of moments estimator of the conditional probability in Equation (26) is given by:

\[Pr[T_j \le X < T_{j+1} | X < T_{j+1}] = \frac{A_j}{A_j + B_j} \;\;\;\;\;\; (29)\]

Hence, by Equations (26) and (29) we have

\[\hat{S}(T_j) = \hat{S}(T_{j+1}) + (\frac{A_j}{A_j + B_j}) \hat{S}(T_{j}) \;\;\;\;\;\; (30)\]

which can be solved interatively for \(j = 1, 2, \ldots, K\). Note that

\[\widehat{S^*}(T_{K+1}) = \widehat{S^*}(\infty) = S^*(\infty) = 0 \;\;\;\;\;\; (31)\]

\[\widehat{S^*}(T_0) = \widehat{S^*}(-\infty) = S^*(-\infty) = 1 \;\;\;\;\;\; (32)\]

Once the values of the survival function at the censoring levels are computed, the plotting positions for the \(A_j\) uncensored observations in the interval \([T_J, T_{j+1})\) (\(j = 0, 1, \ldots, K\)) are computed as

\[\hat{p}_i = [1 - \widehat{S^*}(T_j)] + [\widehat{S^*}(T_j) - \widehat{S^*}(T_{j+1})] \frac{r-a}{A_j - 2a + 1} \;\;\;\;\;\; (33)\]

where \(a\) denotes the plotting position constant, \(0 \le a \le 0.5\), and \(r\) denotes the rank of the \(i\)’th observation among the \(A_j\) uncensored observations in the interval \([T_J, T_{j+1})\). (Tied observations are given distinct ranks.)

For the \(c_j\) observations censored at censoring level \(T_j\) (\(j = 1, 2, \ldots, K\)), the plotting positions are computed as:

\[\hat{p}_i = [1 - \widehat{S^*}(T_j)] \frac{r-a}{c_j - 2a + 1} \;\;\;\;\;\; (34)\]

where \(r\) denotes the rank of the \(i\)’th observation among the \(c_j\) observations censored at censoring level \(T_j\). Note that all the observations censored at the same censoring level are given distinct ranks, even though there is no way to distinguish between them.

gofTestCensored

Help topic: gofTestCensored.

Let \(\underline{x} = c(x_1, x_2, \ldots, x_N)\) denote a vector of \(N\) observations from from some distribution with cdf \(F\). Suppose we want to test the null hypothesis that \(F\) is the cdf of a normal (Gaussian) distribution with some arbitrary mean \(\mu\) and standard deviation \(\sigma\) against the alternative hypothesis that \(F\) is the cdf of some other distribution. The table below shows the random variable for which \(F\) is the assumed cdf, given the value of the argument distribution.

Value of   Random Variable for
distribution Distribution Name which \(F\) is the cdf
“norm” Normal \(X\)
“lnorm” Lognormal (Log-space) \(log(X)\)
“lnormAlt” Lognormal (Untransformed) \(log(X)\)

Assume \(n\) (\(0 < n < N\)) of these observations are known and \(c\) (\(c=N-n\)) of these observations are all censored below (left-censored) or all censored above (right-censored) at \(k\) fixed censoring levels

\[T_1, T_2, \ldots, T_k; \; k \ge 1 \;\;\;\;\;\; (1)\]

For the case when \(k \ge 2\), the data are said to be Type I multiply censored. For the case when \(k=1\), set \(T = T_1\). If the data are left-censored and all \(n\) known observations are greater than or equal to \(T\), or if the data are right-censored and all \(n\) known observations are less than or equal to \(T\), then the data are said to be Type I singly censored (Nelson, 1982, p.7), otherwise they are considered to be Type I multiply censored.

Let \(c_j\) denote the number of observations censored below or above censoring level \(T_j\) for \(j = 1, 2, \ldots, k\), so that

\[\sum_{i=1}^k c_j = c \;\;\;\;\;\; (2)\]

Let \(x_{(1)}, x_{(2)}, \ldots, x_{(N)}\) denote the “ordered” observations, where now “observation” means either the actual observation (for uncensored observations) or the censoring level (for censored observations). For right-censored data, if a censored observation has the same value as an uncensored one, the uncensored observation should be placed first. For left-censored data, if a censored observation has the same value as an uncensored one, the censored observation should be placed first.

Note that in this case the quantity \(x_{(i)}\) does not necessarily represent the \(i\)’th “largest” observation from the (unknown) complete sample.

Note that for singly left-censored data:

\[x_{(1)} = x_{(2)} = \cdots = x_{(c)} = T \;\;\;\;\;\; (3)\]

and for singly right-censored data:

\[x_{(n+1)} = x_{(n+2)} = \cdots = x_{(N)} = T \;\;\;\;\;\; (4)\]

Finally, let \(\Omega\) (omega) denote the set of \(n\) subscripts in the “ordered” sample that correspond to uncensored observations.

Shapiro-Wilk Goodness-of-Fit Test for Singly Censored Data (test="sw")
Equation (8) in the section on gofTest shows that for the case of complete ordered data \(\underline{x}\), the Shapiro-Wilk \(W\)-statistic is the same as the square of the sample product-moment correlation between the vectors \(\underline{a}\) and \(\underline{x}\):

\[W = r(\underline{a}, \underline{x})^2 \;\;\;\;\;\; (5)\]

where

\[r(\underline{x}, \underline{y}) = \frac{\sum_{i=1}^N (x_i - \bar{x})(y_i - \bar{y})}{[\sum_{i=1}^n (x_i - \bar{x})^2 \sum_{i=1}^n (y_i - \bar{y})^2]^{1/2}} \;\;\;\;\;\;\; (6)\]

and \(\underline{a}\) is defined by:

\[\underline{a} = \frac{\underline{m}^T V^{-1}}{[\underline{m}^T V^{-1} V^{-1} \underline{m}]^{1/2}} \;\;\;\;\;\; (7)\]

where \(^T\) denotes the transpose operator, and \(\underline{m}\) is the vector of expected values and \(V\) is the variance-covariance matrix of the order statistics of a random sample of size \(N\) from a standard normal distribution. That is, the values of \(\underline{a}\) are the expected values of the standard normal order statistics weighted by their variance-covariance matrix, and normalized so that

\[\underline{a}^T \underline{a} = 1 \;\;\;\;\;\; (8)\]

Computing Shapiro-Wilk W-Statistic for Singly Censored Data
For the case of singly censored data, following Smith and Bain (1976) and Verrill and Johnson (1988), Royston (1993) generalizes the Shapiro-Wilk \(W\)-statistic to:

\[W = r(\underline{a}_{\Delta}, \underline{x}_{\Delta})^2 \;\;\;\;\;\; (9)\]

where for left singly-censored data:

\[\underline{a}_{\Delta} = (a_{c+1}, a_{c+2}, \ldots, a_{N}) \;\;\;\;\;\; (10)\]

\[\underline{x}_{\Delta} = (x_{(c+1)}, x_{(c+2)}, \ldots, x_{(N)}) \;\;\;\;\;\; (11)\]

and for right singly-censored data:

\[\underline{a}_{\Delta} = (a_1, a_2, \ldots, a_n) \;\;\;\;\;\; (12)\]

\[\underline{x}_{\Delta} = (x_{(1)}, x_{(2)}, \ldots, x_{(n)}) \;\;\;\;\;\; (13)\]

Just like the function gofTest, when test="sw", the function gofTestCensored uses Royston’s (1992a) approximation for the coefficients \(\underline{a}\) (see the section on gofTest).

Computing P-Values for the Shapiro-Wilk Test
Verrill and Johnson (1988) show that the asymptotic distribution of the statistic in Equation (9) above is normal, but the rate of convergence is “surprisingly slow” even for complete samples. They provide a table of empirical percentiles of the distribution for the \(W\)-statistic shown in Equation (9) above for several sample sizes and percentages of censoring.

Based on the tables given in Verrill and Johnson (1988), Royston (1993) approximated the 90’th, 95’th, and 99’th percentiles of the distribution of the z-statistic computed from the \(W\)-statistic. (The distribution of this z-statistic is assumed to be normal, but not necessarily a standard normal.) Denote these percentiles by \(Z_{0.90}\), \(Z_{0.95}\), and \(Z_{0.99}\). The true mean and standard deviation of the z-statistic are estimated by the intercept and slope, respectively, from the linear regression of \(Z_{\alpha}\) on \(\Phi^{-1}(\alpha)\) for \(\alpha\) = 0.9, 0.95, and 0.99, where \(\Phi\) denotes the cumulative distribution function of the standard normal distribution. The p-value associated with this test is then computed as:

\[p = 1 - \Phi(\frac{z - \mu_z}{\sigma_z}) \;\;\;\;\;\; (14)\]

Note: Verrill and Johnson (1988) produced their tables based on Type II censoring. Royston’s (1993) approximation to the p-value of these tests, however, should be fairly accurate for Type I censored data as well.

Testing Goodness-of-Fit for Any Continuous Distribution
The function gofTestCensored extends the Shapiro-Wilk test that accounts for censoring to test for goodness-of-fit for any continuous distribution by using the idea of Chen and Balakrishnan (1995), who proposed a general purpose approximate goodness-of-fit test based on the Cramer-von Mises or Anderson-Darling goodness-of-fit tests for normality. The function gofTestCensored modifies the approach of Chen and Balakrishnan (1995) by using the same first 2 steps, and then applying the Shapiro-Wilk test that accounts for censoring:

  1. Let \(\underline{x} = x_1, x_2, \ldots, x_n\) denote the vector of \(n\) ordered observations, ignoring censoring status. Compute cumulative probabilities for each \(x_i\) based on the cumulative distribution function for the hypothesized distribution. That is, compute \(p_i = F(x_i, \hat{\theta})\), where \(F(x, \theta)\) denotes the hypothesized cumulative distribution function with parameter(s) \(\theta\), and \(\hat{\theta}\) denotes the estimated parameter(s) using an estimation method that accounts for censoring (e.g., assuming a Gamma distribution with alternative parameterization, call the function linkegammaAltCensored).
  2. Compute standard normal deviates based on the computed cumulative probabilities:
    \(y_i = \Phi^{-1}(p_i)\)
  3. Perform the Shapiro-Wilk goodness-of-fit test (that accounts for censoring) on the \(y_i\)’s.

Shapiro-Francia Goodness-of-Fit Test (test="sf")
Equation (15) in the section on gofTest shows that for the complete ordered data \(\underline{x}\), the Shapiro-Francia \(W'\)-statistic is the same as the squared Pearson correlation coefficient associated with a normal probability plot.

Computing Shapiro-Francia W’-Statistic for Censored Data
For the case of singly censored data, following Smith and Bain (1976) and Verrill and Johnson (1988), Royston (1993) extends the computation of the Weisberg-Bingham Approximation to the \(W'\)-statistic to the case of singly censored data:

\[\tilde{W}' = r(\underline{c}_{\Delta}, \underline{x}_{\Delta})^2 \;\;\;\;\;\; (14)\]

where for left singly-censored data:

\[\underline{c}_{\Delta} = (c_{c+1}, c_{c+2}, \ldots, c_{N}) \;\;\;\;\;\; (15)\]

\[\underline{x}_{\Delta} = (x_{(c+1)}, x_{(c+2)}, \ldots, x_{(N)}) \;\;\;\;\;\; (16)\]

and for right singly-censored data:

\[\underline{a}_{\Delta} = (a_1, a_2, \ldots, a_n) \;\;\;\;\;\; (17)\]

\[\underline{x}_{\Delta} = (x_{(1)}, x_{(2)}, \ldots, x_{(n)}) \;\;\;\;\;\; (18)\]

and \(\underline{c}\) is defined as:

\[\underline{c} = \frac{\underline{\tilde{m}}}{[\underline{\tilde{m}}' \underline{\tilde{m}}]^{1/2}} \;\;\;\;\;\; (19)\]

where

\[\tilde{m}_i = \Phi^{-1}(\frac{i - (3/8)}{n + (1/4)}) \;\;\;\;\;\; (20)\]

and \(\Phi\) denotes the standard normal cdf. Note: Do not confuse the elements of the vector \(\underline{c}\) with the scalar \(c\) which denotes the number of censored observations. We use \(\underline{c}\) here to be consistent with the notation in the section on gofTest.

Just like the function gofTest, when test="sf", the function gofTestCensored uses Royston’s (1992a) approximation for the coefficients \(\underline{c}\) (see the section on gofTest).

In general, the Shapiro-Francia test statistic can be extended to multiply censored data using Equation (14) with \(\underline{c}_{\Delta}\) defined as the orderd values of \(c_i\) associated with uncensored observations, and \(\underline{x}_{\Delta}\) defined as the ordered values of \(x_i\) associated with uncensored observations:

\[\underline{c}_{\Delta} = \cup_{i \in \Omega} \;\; c_{(i)} \;\;\;\;\;\; (21)\]

\[\underline{x}_{\Delta} = \cup_{i \in \Omega} \;\; x_{(i)} \;\;\;\;\;\; (22)\]

and where the plotting positions in Equation (20) are replaced with any of the plotting positions available in ppointsCensored (see the description for the argument prob.method).

Computing P-Values for the Shapiro-Francia Test
Verrill and Johnson (1988) show that the asymptotic distribution of the statistic in Equation (14) above is normal, but the rate of convergence is “surprisingly slow” even for complete samples. They provide a table of empirical percentiles of the distribution for the \(\tilde{W}'\)-statistic shown in Equation (14) above for several sample sizes and percentages of censoring.

As for the Shapiro-Wilk test, based on the tables given in Verrill and Johnson (1988), Royston (1993) approximated the 90’th, 95’th, and 99’th percentiles of the distribution of the z-statistic computed from the \(\tilde{W}'\)-statistic. (The distribution of this z-statistic is assumed to be normal, but not necessarily a standard normal.) Denote these percentiles by \(Z_{0.90}\), \(Z_{0.95}\), and \(Z_{0.99}\). The true mean and standard deviation of the z-statistic are estimated by the intercept and slope, respectively, from the linear regression of \(Z_{\alpha}\) on \(\Phi^{-1}(\alpha)\) for \(\alpha\) = 0.9, 0.95, and 0.99, where \(\Phi\) denotes the cumulative distribution function of the standard normal distribution. The p-value associated with this test is then computed as:

\[p = 1 - \Phi(\frac{z - \mu_z}{\sigma_z}) \;\;\;\;\;\; (23)\]

Note: Verrill and Johnson (1988) produced their tables based on Type II censoring. Royston’s (1993) approximation to the p-value of these tests, however, should be fairly accurate for Type I censored data as well, although this is an area that requires further investigation.

Testing Goodness-of-Fit for Any Continuous Distribution
The function gofTestCensored extends the Shapiro-Francia test that accounts for censoring to test for goodness-of-fit for any continuous distribution by using the idea of Chen and Balakrishnan (1995), who proposed a general purpose approximate goodness-of-fit test based on the Cramer-von Mises or Anderson-Darling goodness-of-fit tests for normality. The function gofTestCensored modifies the approach of Chen and Balakrishnan (1995) by using the same first 2 steps, and then applying the Shapiro-Francia test that accounts for censoring:

  1. Let \(\underline{x} = x_1, x_2, \ldots, x_n\) denote the vector of \(n\) ordered observations, ignoring censoring status. Compute cumulative probabilities for each \(x_i\) based on the cumulative distribution function for the hypothesized distribution. That is, compute \(p_i = F(x_i, \hat{\theta})\) where \(F(x, \theta)\) denotes the hypothesized cumulative distribution function with parameter(s) \(\theta\), and \(\hat{\theta}\) denotes the estimated parameter(s) using an estimation method that accounts for censoring (e.g., assuming a Gamma distribution with alternative parameterization, call the function linkegammaAltCensored).
  2. Compute standard normal deviates based on the computed cumulative probabilities:
    \(y_i = \Phi^{-1}(p_i)\)
  3. Perform the Shapiro-Francia goodness-of-fit test (that accounts for censoring) on the \(y_i\)’s.

Probability Plot Correlation Coefficient (PPCC) Goodness-of-Fit Test (test="ppcc")
The function gofTestCensored computes the PPCC test statistic using Blom plotting positions. It can be shown that the square of this statistic is equivalent to the Weisberg-Bingham Approximation to the Shapiro-Francia \(W'\)-test (Weisberg and Bingham, 1975; Royston, 1993). Thus the PPCC goodness-of-fit test is equivalent to the Shapiro-Francia goodness-of-fit test.

boxcoxCensored

Help topic: boxcoxCensored.

Two common assumptions for several standard parametric hypothesis tests are:

  1. The observations all come from a normal distribution.
  2. The observations all come from distributions with the same variance.

For example, the standard one-sample t-test assumes all the observations come from the same normal distribution, and the standard two-sample t-test assumes that all the observations come from a normal distribution with the same variance, although the mean may differ between the two groups.

When the original data do not satisfy the above assumptions, data transformations are often used to attempt to satisfy these assumptions. Box and Cox (1964) presented a formalized method for deciding on a data transformation. Given a random variable \(X\) from some distribution with only positive values, the Box-Cox family of power transformations is defined as:

\(Y\) = \(\frac{X^\lambda - 1}{\lambda}\) \(\lambda \ne 0\)
    \(log(X)\) \(\lambda = 0 \;\;\;\;\;\; (1)\)

where \(Y\) is assumed to come from a normal distribution. This transformation is continuous in \(\lambda\). Note that this transformation also preserves ordering. See the help file for boxcoxTransform for more information on data transformations.

Box and Cox (1964) proposed choosing the appropriate value of \(\lambda\) based on maximizing the likelihood function. Alternatively, an appropriate value of \(\lambda\) can be chosen based on another objective, such as maximizing the probability plot correlation coefficient or the Shapiro-Wilk goodness-of-fit statistic.

Shumway et al. (1989) investigated extending the method of Box and Cox (1964) to the case of Type I censored data, motivated by the desire to produce estimated means and confidence intervals for air monitoring data that included censored values.

In the case when optimize=TRUE, the function boxcoxCensored calls the R function nlminb to minimize the negative value of the objective (i.e., maximize the objective) over the range of possible values of \(\lambda\) specified in the argument lambda. The starting value for the optimization is always \(\lambda=1\) (i.e., no transformation).

The next section explains assumptions and notation, and the section after that explains how the objective is computed for the various options for objective.name.

Assumptions and Notation
Let \(\underline{x}\) denote a random sample of \(N\) observations from some continuous distribution. Assume \(n\) (\(0 < n < N\)) of these observations are known and \(c\) (\(c=N-n\)) of these observations are all censored below (left-censored) or all censored above (right-censored) at \(k\) fixed censoring levels

\[T_1, T_2, \ldots, T_K; \; K \ge 1 \;\;\;\;\;\; (2)\]

For the case when \(K \ge 2\), the data are said to be Type I multiply censored. For the case when \(K=1\), set \(T = T_1\). If the data are left-censored and all \(n\) known observations are greater than or equal to \(T\), or if the data are right-censored and all \(n\) known observations are less than or equal to \(T\), then the data are said to be Type I singly censored (Nelson, 1982, p.7), otherwise they are considered to be Type I multiply censored.

Let \(c_j\) denote the number of observations censored below or above censoring level \(T_j\) for \(j = 1, 2, \ldots, K\), so that

\[\sum_{i=1}^K c_j = c \;\;\;\;\;\; (3)\]

Let \(x_{(1)}, x_{(2)}, \ldots, x_{(N)}\) denote the “ordered” observations, where now “observation” means either the actual observation (for uncensored observations) or the censoring level (for censored observations). For right-censored data, if a censored observation has the same value as an uncensored one, the uncensored observation should be placed first. For left-censored data, if a censored observation has the same value as an uncensored one, the censored observation should be placed first.

Note that in this case the quantity \(x_{(i)}\) does not necessarily represent the \(i\)’th “largest” observation from the (unknown) complete sample.

Finally, let \(\Omega\) (omega) denote the set of \(n\) subscripts in the “ordered” sample that correspond to uncensored observations, and let \(\Omega_j\) denote the set of \(c_j\) subscripts in the “ordered” sample that correspond to the censored observations censored at censoring level \(T_j\) for \(j = 1, 2, \ldots, k\).

We assume that there exists some value of \(\lambda\) such that the transformed observations

\(y_i\) = \(\frac{x_i^\lambda - 1}{\lambda}\) \(\lambda \ne 0\)
    \(log(x_i)\) \(\lambda = 0 \;\;\;\;\;\; (4)\)

(\(i = 1, 2, \ldots, n\)) form a random sample of Type I censored data from a normal distribution.

Note that for the censored observations, Equation (4) becomes:

\(y_{(i)} = T_j^*\) = \(\frac{T_j^\lambda - 1}{\lambda}\) \(\lambda \ne 0\)
    \(log(T_j)\) \(\lambda = 0 \;\;\;\;\;\; (5)\)

where \(i \in \Omega_j\).

Computing the Objective

Objective Based on Probability Plot Correlation Coefficient (objective.name="PPCC")
When objective.name="PPCC", the objective is computed as the value of the normal probability plot correlation coefficient based on the transformed data (see the description of the Probability Plot Correlation Coefficient (PPCC) goodness-of-fit test in the section on gofTestCensored). That is, the objective is the correlation coefficient for the normal quantile-quantile plot for the transformed data. Large values of the PPCC tend to indicate a good fit to a normal distribution.

Objective Based on Shapiro-Wilk Goodness-of-Fit Statistic (objective.name="Shapiro-Wilk")
When objective.name="Shapiro-Wilk", the objective is computed as the value of the Shapiro-Wilk goodness-of-fit statistic based on the transformed data (see the description of the Shapiro-Wilk test in the section on gofTestCensored). Large values of the Shapiro-Wilk statistic tend to indicate a good fit to a normal distribution.

Objective Based on Log-Likelihood Function (objective.name="Log-Likelihood")
When objective.name="Log-Likelihood", the objective is computed as the value of the log-likelihood function. Assuming the transformed observations in Equation (4) above come from a normal distribution with mean \(\mu\) and standard deviation \(\sigma\), we can use the change of variable formula to write the log-likelihood function as follows.

For Type I left censored data, the likelihood function is given by:

\[log[L(\lambda, \mu, \sigma)] = log[{N \choose c_1 c_2 \ldots c_k n}] + \sum_{j=1}^k c_j log[F(T_j^*)] + \sum_{i \in \Omega} log\{f[y_{(i)}]\} + (\lambda - 1) \sum_{i \in \Omega} log[x_{(i)}] \;\;\;\;\;\; (6)\]

where \(f\) and \(F\) denote the probability density function (pdf) and cumulative distribution function (cdf) of the population. That is,

\[f(t) = \phi(\frac{t-\mu}{\sigma}) \;\;\;\;\;\; (7)\]

\[F(t) = \Phi(\frac{t-\mu}{\sigma}) \;\;\;\;\;\; (8)\]

where \(\phi\) and \(\Phi\) denote the pdf and cdf of the standard normal distribution, respectively (Shumway et al., 1989). For left singly censored data, Equation (6) simplifies to:

\[log[L(\lambda, \mu, \sigma)] = log[{N \choose c}] + c log[F(T^*)] + \sum_{i = c+1}^N log\{f[y_{(i)}]\} + (\lambda - 1) \sum_{i = c+1}^N log[x_{(i)}] \;\;\;\;\;\; (9)\]

Similarly, for Type I right censored data, the likelihood function is given by:

\[log[L(\lambda, \mu, \sigma)] = log[{N \choose c_1 c_2 \ldots c_k n}] + \sum_{j=1}^k c_j log[1 - F(T_j^*)] + \sum_{i \in \Omega} log\{f[y_{(i)}]\} + (\lambda - 1) \sum_{i \in \Omega} log[x_{(i)}] \;\;\;\;\;\; (10)\]

and for right singly censored data this simplifies to:

\[log[L(\lambda, \mu, \sigma)] = log[{N \choose c}] + c log[1 - F(T^*)] + \sum_{i = 1}^n log\{f[y_{(i)}]\} + (\lambda - 1) \sum_{i = 1}^n log[x_{(i)}] \;\;\;\;\;\; (11)\]

For a fixed value of \(\lambda\), the log-likelihood function is maximized by replacing \(\mu\) and \(\sigma\) with their maximum likelihood estimators (see Maximum Likelihood Estimation in the section on enormCensored).

Thus, when optimize=TRUE, Equation (6) or (10) is maximized by iteratively solving for \(\lambda\) using the MLEs for \(\mu\) and \(\sigma\). When optimize=FALSE, the value of the objective is computed by using Equation (6) or (10), using the values of \(\lambda\) specified in the argument lambda, and using the MLEs of \(\mu\) and \(\sigma\).