gldrmCI: Confidence intervals for gldrm coefficients

Description Usage Arguments Value Examples

View source: R/gldrmCI.R

Description

Calculates a Wald, likelihood ratio, or score confidence interval for a single gldrm coefficient. Also calculates upper or lower confidence bounds. Wald confidence intervals and bounds are calculated from the standard errors which are available from the gldrm model fit. For likelihood ratio and score intervals and bounds, a bisection search method is used, which takes longer to run.

Usage

1
2
gldrmCI(gldrmFit, term, test = c("Wald", "LRT", "Score"), level = 0.95,
  type = c("2-sided", "lb", "ub"), eps = 1e-10, maxiter = 100)

Arguments

gldrmFit

A gldrm model fit. Must be an S3 object of class "gldrm", returned from the gldrm function.

term

Character string containing the name of the coefficient of interest. The coefficient names are the names of the beta component of the fitted model object. They can also be obtained from the printed model output. Usually the names match the formula syntax, but can be more complicated for categorical variables and interaction terms.

test

Character string for the type confidence interval. Options are "Wald", "LRT" (for likelihood ratio), and "Score".

level

Confidence level of the interval. Should be between zero and one.

type

Character string containing "2-sided" for a two-sided confidence interval, "lb" for a lower bound, or "ub" for an upper bound.

eps

Convergence threshold. Only applies for test = "LRT" and test = "Score". Convergence is reached when likelihood ratio p-value is within eps of the target p-value, based on the level of the test. For example, a two-sided 95% confidence interval has target p-value of 0.025 for both the upper and lower bounds. A 95% confidence bound has target p-value 0.05.

maxiter

The maximum number of bisection method iterations for likelihood ratio intervals or bounds. For two-sided intervals, maxiter iterations are allowed for each bound.

Value

An S3 object of class 'gldrmCI', which is a list of the following items.

Examples

1
2
3
4
5
6
7
8
9
data(iris, package="datasets")

### Fit gldrm with all variables
fit <- gldrm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species,
             data=iris, link="log")

### Wald 95% confidence interval for Sepal.Width
ci <- gldrmCI(fit, "Sepal.Width", test="Wald", level=.95, type="2-sided")
ci

gldrm documentation built on April 13, 2018, 9:04 a.m.