Learn R Programming

Epi (version 2.58)

ci.eta: Linear predictor (eta) from a formula, coefficients, vcov and a prediction frame.

Description

Computes the linear predictor with its confidence limits from the model formula and the estimated parameters with the vcov.

Usage

ci.eta(form, cf, vcv, newdata,
       name.check = TRUE,
       alpha = 0.05, df = Inf, raw = FALSE)

Value

The linear predictor for the newdata with a confidence interval as a nrow(newdata) by 3 matrix. If raw=TRUE, a list the linear predictor (eta) and its variance-covariance matrix (var).

Arguments

form

A model formula. A one-sided formula will suffice; left side will be ignored if two-sided.

cf

Coefficients from a model using formula.

vcv

variance-covariance matrix from a model using formula.

newdata

Prediction data frame with variables used in formula. Can also be a list of 2 or 4 prediction frames, for details see ci.lin.

name.check

Logical. Check if the column names of the genereated model matrix are identical to the names of the supplied coef vector.

alpha

Significance level for calculation of c.i.

df

Integer. Number of degrees of freedom in the t-distribution used to compute the quantiles used to construct the confidence intervals.

raw

Logical. Should predictions and their vcov be returned instead of predictions and confidence limits?

Author

Bendix Carstensen, http://bendixcarstensen.com

Details

Does pretty much the same as ci.lin, but requires only a formula and coefficients with vcov and not a full model object. Designed to avoid saving entire (homongously large) model objects and still be able to compute predictions. But only the linear predictor is returned, if there is a link in your model function it is your own responsibility to back-transform. If the model formula contains reference to vectors of spline knots or similar these must be in the global environment.

There is no guarantee that this function works for models that do not inherit from lm. But there is a guarantee that it will not work for gam objects with s() terms.

See Also

ci.lin