region: Calculate a Confidence Region

Description Usage Arguments Value See Also

View source: R/utils.R

Description

Calculates a confidence region. se.fit from predict.glm is multiplied by z and added or subtracted from fits to give hi and lo columns in return value. z is normal quantile for the one-tailed probablitity corresponding to conf, e.g. ~ 1.96 for conf = 0.95. If non-missing y is only 0 or 1, the model family is binomial and resulting confidence intervals are back-transformed using plogis.

Usage

1
2
region(x, y, family = if (all(y %in% 0:1, na.rm = TRUE)) "binomial" else
  "gaussian", length.out = 1000, conf = 0.95, ...)

Arguments

x

x values

y

y values

family

gaussian by default, or binomial for all y either zero or 1

length.out

number of prediction points

conf

width of confidence interval; logical TRUE defaults to 0.95

...

passed to model

Value

data.frame with x, y, hi, lo at 1000 points

See Also

https://stackoverflow.com/questions/14423325/confidence-intervals-for-predictions-from-logistic-regression

http://www.rnr.lsu.edu/bret/BretWebSiteDocs/GLMCI.pdf

https://stat.ethz.ch/pipermail/r-help/2010-September/254465.html

http://r.789695.n4.nabble.com/Confidence-Intervals-for-logistic-regression-td2315932.html

Other regression functions: metastats, model


metaplot documentation built on May 1, 2019, 10:17 p.m.

Related to region in metaplot...