% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Llogis.R
\name{Llogis}
\alias{Llogis}
\alias{dllogis}
\alias{pllogis}
\alias{qllogis}
\alias{hllogis}
\alias{Hllogis}
\alias{rllogis}
\title{The log-logistic distribution}
\usage{
dllogis(x, shape = 1, scale = 1, log = FALSE)

pllogis(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)

qllogis(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)

rllogis(n, shape = 1, scale = 1)

hllogis(x, shape = 1, scale = 1, log = FALSE)

Hllogis(x, shape = 1, scale = 1, log = FALSE)
}
\arguments{
\item{x, q}{vector of quantiles.}

\item{shape, scale}{vector of shape and scale parameters.}

\item{log, log.p}{logical; if TRUE, probabilities p are given as
log(p).}

\item{lower.tail}{logical; if TRUE (default), probabilities are
\eqn{P(X \le x)}{P(X <= x)}, otherwise, \eqn{P(X > x)}{P(X > x)}.}

\item{p}{vector of probabilities.}

\item{n}{number of observations. If \code{length(n) > 1}, the
length is taken to be the number required.}
}
\value{
\code{dllogis} gives the density, \code{pllogis} gives the
distribution function, \code{qllogis} gives the quantile function,
\code{hllogis} gives the hazard function, \code{Hllogis} gives the
cumulative hazard function, and \code{rllogis} generates random
deviates.
}
\description{
Density, distribution function, hazards, quantile function and
random generation for the log-logistic distribution.
}
\details{
The log-logistic distribution with \code{shape} parameter
\eqn{a>0} and \code{scale} parameter \eqn{b>0} has probability
density function

\deqn{f(x | a, b) = (a/b) (x/b)^{a-1} / (1 + (x/b)^a)^2}

and hazard

\deqn{h(x | a, b) = (a/b) (x/b)^{a-1} / (1 + (x/b)^a)}

for \eqn{x>0}. The hazard is decreasing for shape \eqn{a\leq 1}{a
<= 1}, and unimodal for \eqn{a > 1}.

The probability distribution function is \deqn{F(x | a, b) = 1 - 1
/ (1 + (x/b)^a)}

If \eqn{a > 1}, the mean is \eqn{b c / sin(c)}, and if \eqn{a > 2}
the variance is \eqn{b^2 * (2*c/sin(2*c) - c^2/sin(c)^2)}, where
\eqn{c = \pi/a}, otherwise these are undefined.
}
\note{
Various different parameterisations of this distribution are
used.  In the one used here, the interpretation of the parameters
is the same as in the standard Weibull distribution
(\code{\link{dweibull}}).  Like the Weibull, the survivor function
is a transformation of \eqn{(x/b)^a} from the non-negative real line to [0,1],
but with a different link function.  Covariates on \eqn{b}
represent time acceleration factors, or ratios of expected
survival.

The same parameterisation is also used in
\code{\link[eha:Loglogistic]{eha::dllogis}} in the \pkg{eha} package.
}
\references{
Stata Press (2007) Stata release 10 manual: Survival analysis
and epidemiological tables.
}
\seealso{
\code{\link{dweibull}}
}
\author{
Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>
}
\keyword{distribution}
