mlreg

0th

Percentile

Fit a Linear Model by Maximum Likelihood

Fits a linear model by maximum likelihood assuming a variety of response distributions.

Keywords
regression
Usage
mlreg.fit(X, y, weights=NULL, dist="logistic", init=NULL, scale=NULL)
mlreg.fit.zero(y, weights=NULL, dist="logistic", init=NULL, scale=NULL)
Arguments
X
the design matrix. Rows containing missing values (in X or y) will be removed.
y
numeric response vector. Missing values will be removed.
weights
vector of non-negative weights.
dist
character string giving the name of the response distribution. The possibilities are "weibull", "exponential", "gaussian", "logistic", "lognormal" or "loglogistic".
init
numeric vector of initial values for the parameters.
scale
if specified then the scale parameter is fixed at the given value.
Details

This function is merely a convenient wrapper for calling the survreg.fit function, which is part of the survival library by Terry Therneau. It fits the model y = X*b + scale*e where b is the vector of regression coefficients and e is a vector of mean-zero errors, by maximum likelihood. The function mlreg.fit.zero assumes that the mean is zero and fits y = scale*e, estimating only the scale parameter.

Value

  • See the documentation for survreg.object

See Also

survreg, survreg.object

Aliases
  • mlreg
  • mlreg.fit
  • mlreg.fit.zero
Examples
x <- 1:50
y <- x + 2*rnorm(50)
X <- cbind(1,x)
out <- mlreg.fit(X,y,dist="logistic")
Documentation reproduced from package statmod, version 0.6, License: GPL version 2 or newer

Community examples

Looks like there are no examples yet.