ewas: ewas

Description Usage Arguments Value See Also Examples

View source: R/ewas.R

Description

Run environment-wide association study, optionally using svydesign from the survey package Note: It is possible to specify ids and/or strata. When ids is specified without strata, the standard error is infinite and the anova calculation for categorical variables fails. This is due to the lonely psu problem.

Usage

1
2
3
4
ewas(d, cat_vars = NULL, cont_vars = NULL, y, cat_covars = NULL,
  cont_covars = NULL, regression_family = "gaussian",
  allowed_nonvarying = NULL, min_n = 200, weights = NULL,
  ids = NULL, strata = NULL, fpc = NULL, ...)

Arguments

d

data.frame containing all of the data

cat_vars

List of variables to regress that are categorical or binary

cont_vars

List of variables to regress that are continuous

y

name(s) of response variable(s)

cat_covars

List of covariates that are categorical or binary

cont_covars

List of covariates that are continuous

regression_family

family for the regression model as specified in glm ('gaussian' by default)

allowed_nonvarying

list of covariates that are excluded from the regression when they do not vary instead of returning a NULL result.

min_n

minimum number of observations required (after dropping those with NA values) before running the regression (200 by default)

weights

NULL by default (for unweighted). May be set to a string name of a single weight to use for every variable, or a named list that maps variable names to the weights that should be used for that variable's regression

ids

NULL by default (for no clusters). May be set to a string name of a column in the data which provides cluster IDs.

strata

NULL by default (for no strata). May be set to a string name of a column in the data which provides strata IDs.

fpc

NULL by default (for no fpc). May be set to a string name of a column in the data which provides fpc values.

...

other arguments passed to svydesign which are ignored if 'weights' is NULL

Value

data frame containing following fields Variable, Sample Size, Converged, SE, Beta, Variable p-value, LRT, AIC, pval, phenotype, weight

See Also

Other analysis functions: ewas_pval_adjust

Examples

1
2
3
4
## Not run: 
ewas(d, cat_vars, cont_vars, y, cat_covars, cont_covars, regression_family)

## End(Not run)

HallLab/clarite documentation built on Oct. 27, 2020, 6:27 p.m.