tidy.maxLik: tidy and glance methods for maxLik objects

tidy.maxLikR Documentation

tidy and glance methods for maxLik objects

Description

These methods return summary information about the estimated model. Both require the tibble package to be installed.

Usage

## S3 method for class 'maxLik'
tidy(x,  ...)
## S3 method for class 'maxLik'
glance(x, ...)

Arguments

x

object of class 'maxLik'.

...

Not used.

Value

For tidy(), a tibble with columns:

term

The name of the estimated parameter (parameters are sequentially numbered if names missing).

estimate

The estimated parameter.

std.error

The standard error of the estimate.

statistic

The z-statistic of the estimate.

p.value

The p-value.

This is essentially the same table as summary-method prints, just in form of a tibble (data frame).

For glance(), a one-row tibble with columns:

df

The degrees of freedom of the model.

logLik

The log-likelihood of the model.

AIC

Akaike's Information Criterion for the model.

nobs

The number of observations, if this is available, otherwise NA.

Author(s)

David Hugh-Jones

See Also

The functions tidy and glance in package generics, and summary to display the “standard” summary information.

Examples

## Example with a single parameter
t <- rexp(100, 2)
loglik <- function(theta) log(theta) - theta*t
a <- maxLik(loglik, start=2)
tidy(a)
glance(a)
## Example with a parameter vector
x <- rnorm(100)
loglik <- function(theta) {
   dnorm(x, mean=theta[1], sd=theta[2], log=TRUE)
}
a <- maxLik(loglik, start=c(mu=0, sd=1))
tidy(a)
glance(a)

maxLik documentation built on May 29, 2024, 2:32 a.m.