Learn R Programming

coefplot (version 1.2.9)

extract.coef.maxLik: extract.coef.maxLik

Description

Extract Coefficient Information from Models

Usage

# S3 method for maxLik
extract.coef(model, ...)

Value

A data.frame containing the coefficient, the standard error and the variable name.

Arguments

model

Model object from which to extract information.

...

Further arguments

Author

Jared P. Lander

Details

Gets the coefficient values and variable names from a model.

Examples

Run this code
# \dontshow{
if(requireNamespace('maxLik', quietly=TRUE))
{
# }
library(maxLik)
loglik <- function(param) {
 mu <- param[1]
 sigma <- param[2]
 ll <- -0.5*N*log(2*pi) - N*log(sigma) - sum(0.5*(x - mu)^2/sigma^2)
ll
}
x <- rnorm(1000, 1, 2) # use mean=1, stdd=2
N <- length(x)
res <- maxLik(loglik, start=c(0,1)) # use 'wrong' start values
extract.coef(res)
# \dontshow{
}
# }

Run the code above in your browser using DataLab