Learn R Programming

BivarP (version 1.0)

gammafit: Estimation of parameters of the Gamma distribution

Description

Likelihood estimation of parameters of the Gamma distribution. Data can be right censored.

Usage

gammafit(time, event)

Arguments

time
numeric vector. For right censored data, this is the follow up time.
event
status indicator vector, 0=alive, 1=dead.

Value

A list with the following components:
par
best estimate of parameter vector c(shape, scale)
value
value of the likelihood at termination.
feval
number of times the likelihood was evaluated.
restarts
number of times the algorithm had to be restarted when it stagnated.
convergence
an integer code indicating type of convergence. 0 indicates successful convergence. Positive integer codes indicate failure to converge.
message
a text message indicating the type of convergence or failure.

Examples

Run this code
n <- 30
t <- rgamma(n, shape=2, scale=100)
ev <- round(runif(n), 0)
gammafit(t, ev)

Run the code above in your browser using DataLab