tidy.maxLik | R Documentation |
These methods return summary information about the estimated model. Both require the tibble package to be installed.
## S3 method for class 'maxLik'
tidy(x, ...)
## S3 method for class 'maxLik'
glance(x, ...)
x |
object of class 'maxLik'. |
... |
Not used. |
For tidy()
, a tibble with columns:
The name of the estimated parameter (parameters are sequentially numbered if names missing).
The estimated parameter.
The standard error of the estimate.
The z
-statistic of the estimate.
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:
The degrees of freedom of the model.
The log-likelihood of the model.
Akaike's Information Criterion for the model.
The number of observations, if this is available, otherwise NA
.
David Hugh-Jones
The functions tidy
and
glance
in package generics, and
summary
to display the
“standard” summary information.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.