profile.egf {epigrowthfit}R Documentation

Univariate Likelihood Profiles

Description

Computes univariate likelihood profiles of fixed effect coefficients, random effect covariance parameters, and linear combinations thereof, including population fitted values.

Usage

## S3 method for class 'egf'
profile(fitted, level = 0.95,
        A = seq_along(par), grid = 12L,
        parallel = egf_parallel(), trace = FALSE,
        top = egf_top(fitted), subset = NULL, select = NULL, ...)

## S3 method for class 'profile.egf'
confint(object, parm = seq_along(object), level = attr(object, "level"),
        class = FALSE, ...)

## S3 method for class 'profile.egf'
plot(x, parm = seq_along(x), level = attr(x, "level"),
     type = c("z", "abs(z)", "z^2"), ...)

Arguments

fitted

an egf object.

level

a number in the interval (0,1) indicating a confidence level. Profiles are computed up to a change in deviance equal to qchisq(level, df = 1).

A

a numeric matrix with 1+p columns, where p = length(coef(fitted)), in which case each row specifies a linear combination of the elements of c(1, coef(fitted)) to be profiled; or a valid index vector for coef(fitted), in which case the indexed elements are profiled; or NULL, in which case population fitted values are profiled.

grid

a positive integer. Step sizes chosen adaptively by tmbprofile will generate approximately this many points on each side of a profile's minimum point.

parallel

an egf_parallel object defining options for R level parallelization.

trace

a logical. If TRUE, then basic tracing messages indicating progress are printed. These may be mixed with optimizer output depending on fitted[["control"]][["trace"]].

top

a subset of egf_top(fitted) naming top level nonlinear model parameters for which profiles on population fitted values should be profiled.

subset, select

index vectors for the rows and columns of model.frame(fitted, "combined") or language objects evaluating to such vectors. subset indicates fitting windows for which profiles should be computed; the default indicates all. select indicates variables that should be appended to the result; the default indicates none. Evaluation of language objects follows the implementation of subset.data.frame.

...

additional arguments passed from or to other methods.

object, x

a profile.egf object.

parm

a valid index vector for object or x indicating a subset of the profiles.

class

a logical. If TRUE and if object was created by profile(A = NULL), then the value of the method call is a confint.egf object, not a matrix.

type

a character string indicating which of z, |z|, and z^{2} is plotted.

Details

Computation of likelihood profiles is typically expensive, requiring estimation of many restricted models. It is parallelized at the C++ level when there is OpenMP support and fitted[["control"]][["omp_num_threads"]] is set to an integer greater than 1. When there is no OpenMP support, it can still be parallelized at the R level with appropriate setting of argument parallel.

Value

A list of length nrow(A) inheriting from classes profile.egf and profile. Each element is a data frame specifying a profile, with two variables:

z

a numeric vector containing profile z-statistics. The profile z-statistic is the appropriately signed square root of the change in deviance under the restricted model.

par.vals

a numeric matrix with one column containing values of the linear combination specified by A[i, ].

The confidence level level is preserved as an attribute.

See Also

The generic function profile. The more basic “next” method for generic function plot, namely plot.profile.

Examples


example("egf", package = "epigrowthfit")

zz <- profile(m1, A = NULL,
              top = "log(r)", subset = quote(country == "A" & wave == 1))
str(zz)

confint(zz, class = TRUE)

pty <- c("z", "abs(z)", "z^2")
bty <- c("l", "u", "u")
for (i in 1:3)
    plot(zz, type = pty[i], bty = bty[i], las = 1)


[Package epigrowthfit version 0.15.3 Index]