Description Usage Arguments Value References Examples
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.
1 2 3 |
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 |
merror |
Logical value for whether there is measurement error. |
integrate_tol |
Numeric value specifying the |
integrate_tol_hessian |
Same as |
estimate_var |
Logical value for whether to return variance-covariance matrix for parameter estimates. |
fix_posdef |
Logical value for whether to repeatedly reduce
|
... |
Additional arguments to pass to |
List containing:
Numeric vector of parameter estimates.
Variance-covariance matrix.
Returned nlminb
object from maximizing the
log-likelihood function.
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
.
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.