xopt: Optimal X

View source: R/xopt.R

xoptR Documentation

Optimal X

Description

Evaluate the optimal x and its SE in a quadratic LM.

Usage

xopt(model, se = TRUE)

Arguments

model

a fitted lm or glm of the form y~x+I(x^2).

se

whether to report the standard error.

Value

List containing est (estimated optimal x) and se (standard error), or if se = FALSE a simple number.

Note

The standard error is evaluated using delta method approximation.

The optimal x is the peak or bottom of the quadratic curve. See p. 54 in Magnusson (2002).

References

Magnusson, A. (2002). Survival rates of coho (Oncorhynchus kisutch) and chinook salmon (O. tshawytscha) released from hatcheries on the U.S. and Canadian Pacific coast 1972–1998, with respect to climate and habitat effects. M.S. thesis, University of Washington.


arnima-github/arni documentation built on Oct. 28, 2023, 6:18 p.m.