estimate_confint_contrast: Computes point estimates, confidence intervals and P-values...

Description Usage Arguments Details See Also Examples

View source: R/main.R

Description

This function combines outputs from estimate_contrast, confint_contrast and p_value_contrast to provide a 4-values vector with point estimate (1st value), lower and upper boundaries of the confidence interval (2nd and 3rd values) and P-value (4th value) comparing the contrast to H0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
estimate_confint_contrast(
  model,
  contrast,
  method = NULL,
  level = 0.95,
  force = FALSE,
  debuglevel = 1,
  H0 = 0,
  alternative = c("two.sided", "less", "greater"),
  ...
)

Arguments

model

a fitted statistical model such as a glm or a coxph.

contrast

numeric vector of the same length as the number of coefficients in the model; it describes the contrast sum(contrast*fixcoef(model)).

method

character string value; specification of the algorithm used (implementation dependent). NULL must be accepted. The default method is "Wald". With the default confint_contrast and p_value_contrast, the only supported values are: "Wald", "wald" and "SlowWald". All three are equivalent but "SlowWald" is slower and is used for debug purpose only. If confint_contrast and p_value_contrast are specialized, they may provide other methods.

level

numeric value between 0 and 1; nominal two-sided confidence level of the confidence interval.

force

logical; if TRUE, force computation of P-values in case of convergence problems.

debuglevel

integer value; set to 0 (default) to disable warnings, 1 to enable warnings and 2 to enable warnings and notes.

H0

numeric value; the value of the contrast under the null hypothesis.

alternative

a character string specifying the alternative hypothesis,

...

Additional parameters that may be used by some implementations.

Details

When alternative is "less" or "greater", a one-sided confidence interval and a one-sided P-value are generated. If H0 is not zero, the P-value compares the estimate to the value of H0, but the estimate and confidence interval are unchanged.

See Also

Other Contrast functions: confint_contrast(), estimate_contrast(), p_value_contrast()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(mtcars)
model1 = glm(family="gaussian", data=mtcars, hp ~ 0+factor(gear))
# do cars with 5 gears have more horse power (hp) than cars with 4 gears ?
estimate_confint_contrast(model1, c(0,-1,1))

# now, we fit an equivalent model (same distribution and same predictions)
model2 = glm(family=gaussian(log), data=mtcars, hp ~ 0+factor(gear))

# do cars with 5 gears have at least twice the horse power than cars with 4 gears ?

estimate_confint_contrast(model2, c(0,-1,0.5))

glmglrt documentation built on Aug. 7, 2020, 9:10 a.m.