local_mfdr | R Documentation |
local_mfdr()
is called by summary.ncvreg()
, which typically offers a more convenient interface to users.
If, however, you are working with local mfdrs programmatically rather than interactively, you probably want to
use local_mfdr()
, which skips the sorting, filtering, and print formatting of summary.ncvreg()
.
local_mfdr(
fit,
lambda,
X = NULL,
y = NULL,
method = c("ashr", "kernel"),
sigma,
...
)
fit |
A fitted |
lambda |
The value of lambda at which inference should be carried out. |
X , y |
The design matrix and response used to fit the model; in most cases, it is not necessary to provide
|
method |
What method should be used to calculate the local fdr? Options are |
sigma |
For linear regression models, users can supply an estimate of the residual standard deviation. The default is to use RSS / DF, where degrees of freedom are approximated using the number of nonzero coefficients. |
... |
Additional arguments to |
If all features are penalized, then the object returns a data frame with one row per feature and four columns:
Estimate
: The coefficient estimate from the penalized regression fit
z
: A test statistic that approximately follows a standard normal distribution under the null hypothesis that the
feature is marginally independent of the outcome
mfdr
: The estimated marginal local false discovery rate
Selected
: Features with nonzero coefficient estimates are given an asterisk
If some features are penalized and others are not, then a list is returned with two elements: pen.vars
, which consists
of the data frame described above, and unpen.vars
, a data frame with four columns: Estimate
, SE
, Statistic
, and
p.value
. The standard errors and p-values are based on a classical lm
/glm
/coxph
model using the effect of the
penalized features as an offset.
summary.ncvreg()
# Linear regression
data(Prostate)
fit <- ncvreg(Prostate$X, Prostate$y)
local_mfdr(fit, 0.1)
fit <- ncvreg(Prostate$X, Prostate$y, penalty.factor=rep(0:1, each=4))
local_mfdr(fit, 0.1)
# Logistic regression
data(Heart)
X <- Heart$X
y <- Heart$y
fit <- ncvreg(X, y, family='binomial')
local_mfdr(fit, 0.1)
# Cox regression
data(Lung)
X <- Lung$X
y <- Lung$y
fit <- ncvsurv(X, y)
local_mfdr(fit, 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.