gdfa: Gamma Discriminant Function Approach for Estimating Odds...

Description Usage Arguments Value References Examples

Description

Assumes exposure given covariates and outcome is a constant-scale Gamma regression. Exposure measurements can be assumed precise or subject to multiplicative lognormal measurement error. Parameters are estimated using maximum likelihood.

Usage

1
2
3
gdfa(y, xtilde, c = NULL, constant_or = TRUE, merror = FALSE,
  integrate_tol = 1e-08, integrate_tol_hessian = integrate_tol,
  estimate_var = TRUE, fix_posdef = TRUE, ...)

Arguments

y

Numeric vector of Y values.

xtilde

Numeric vector (or list of numeric vectors, if there are replicates) of Xtilde values.

c

Numeric matrix with C values (if any), with one row for each subject. Can be a vector if there is only 1 covariate.

constant_or

Logical value for whether to assume a constant odds ratio for X, which means that gamma_y = 0. If NULL, model is fit with and without this assumption, and a likelihood ratio test is performed to test it.

merror

Logical value for whether there is measurement error.

integrate_tol

Numeric value specifying the tol input to hcubature.

integrate_tol_hessian

Same as integrate_tol, but for use when estimating the Hessian matrix only. Sometimes more precise integration (i.e. smaller tolerance) helps prevent cases where the inverse Hessian is not positive definite.

estimate_var

Logical value for whether to return variance-covariance matrix for parameter estimates.

fix_posdef

Logical value for whether to repeatedly reduce integrate_tol_hessian by factor of 5 and re-estimate Hessian to try to avoid non-positive definite variance-covariance matrix.

...

Additional arguments to pass to nlminb.

Value

List containing:

  1. Numeric vector of parameter estimates.

  2. Variance-covariance matrix.

  3. Returned nlminb object from maximizing the log-likelihood function.

  4. Akaike information criterion (AIC).

If constant_or = NULL, two such lists are returned (one under a constant odds ratio assumption and one not), along with a likelihood ratio test for H0: gamma_y = 0, which is equivalent to H0: odds ratio is constant.

References

Whitcomb, B.W., Perkins, N.J., Zhang, Z., Ye, A., and Lyles, R. H. (2012) "Assessment of skewed exposure in case-control studies with pooling." Stat. Med. 31: 2461–2472.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Load data frame with (Y, X, Xtilde, C) values for 250 subjects and list
# of Xtilde values where 25 subjects have replicates. Xtilde values are
# affected by measurement error. True log-OR = 0.5 and sigsq_m = 0.5.
data(dat_gdfa)
dat <- dat_gdfa$dat
reps <- dat_gdfa$reps

# Estimate log-OR for X and Y adjusted for C using true X values
# (unobservable truth).
fit.unobservable <- gdfa(
  y = dat$y,
  xtilde = dat$x,
  c = dat$c,
  merror = FALSE
)
fit.unobservable$estimates

# Estimate log-OR for X and Y adjusted for C using observed Xtilde values,
# ignoring measurement error.
fit.naive <- gdfa(
  y = dat$y,
  xtilde = dat$xtilde,
  c = dat$c,
  merror = FALSE
)
fit.naive$estimates

# Repeat, but accounting for measurement error. Takes a few minutes to run
# due to numerical integration.
## Not run: 
fit.corrected <- gdfa(
  y = dat$y,
  xtilde = reps,
  c = dat$c,
  merror = TRUE,
  integrate_tol = 1e-4,
  control = list(trace = 1)
)
fit.corrected$estimates

## End(Not run)

# Same as previous, but allowing for non-constant odds ratio.
## Not run: 
fit.nonconstant <- gdfa(
  y = dat$y,
  xtilde = reps,
  c = dat$c,
  constant_or = FALSE,
  merror = TRUE,
  integrate_tol = 1e-4,
  control = list(trace = 1)
)
fit.nonconstant$estimates

## End(Not run)

# Perform likelihood ratio test for H0: odds ratio is constant.
## Not run: 
lrt <- gdfa(
  y = dat$y,
  xtilde = reps,
  c = dat$c,
  constant_or = NULL,
  merror = TRUE,
  integrate_tol = 1e-4,
  control = list(trace = 1)
)
lrt$fit.constant$estimates

## End(Not run)

vandomed/meuc documentation built on May 12, 2019, 6:17 p.m.