glr: Generalized Likelihood Ratio test

Description Usage Arguments Details Value Note See Also Examples

Description

Conducts a generalized likelihood ratio test testing whether β \in (-c,c). Covariates can be accommodated.

Usage

1
2
3
4
  glr(data, bim, xcols = NULL, ycol = NULL, covariateCol = NULL,
      formula = NULL, c, robust = FALSE, model = 'additive',
      m = 200, bse = 5, lolim = NULL, hilim = NULL, multiThread = 1,
      family='gaussian',plinkCC=F)

Arguments

data

a data frame includes a column for the response variable, one or multiple columns of genotype data (coded as 0, 1, 2, or NA), and optionally columns for covariates. Headers are assumed. If the data is from related individuals, an additional column named 'FID' needs to be included to specify the related structure. Using the PLINK toolkit with option --recodeA can produce the file in the required format and is recommended.

bim

a data frame with six columns representing chromosome, SNP ID, physical distance, base pair position, effective allele, and reference allele. i.e. data from a file in PLINK binary format (bim). No header is assumed, but the ordering of the columns must follow the standard bim file format.

ycol

numeric; column index in the data data frame for the column representing the response variable.

xcols

numeric vector; the column range in the data where genotype information is stored. Note that although a range of X is required, only one SNP at a time is calculated.

covariateCol

numeric or numeric vector; optional argument specifying which columns represent covariates. If left as NULL, no covariates will be included and the model Y~snp will be used.

formula

string; this is an alternative way of specifying model rather than using xcols and ycol arguments. This model follows the same format as the glm function (e.g. Y~snp1+age+sex). Note that in the case where multiple SNPs are included, only the first SNP will be considered (e.g. given Y~snp1+snp2, the function will consider snp1 as the parameter of interests). The function can automatically identify SNPs with rsID as proper Xs, and would treat all other predictors as covariates.

c

numeric; interval of Null Hypothesis to be tested.

robust

logical; default FALSE. If TRUE, then a robust adjustment is applied to the likelihood function to account for clustering in the data; See robust_forCluster.

model

a string that specifies the mode of inheritance parameterization:
additive, dominant, recessive, or overdominance. Default additive.

m

numeric; the density of the grid at which to compute the standardized likelihood function. A beta grid is defined as the grid of values for the SNP parameter used to evaluate the likelihood function.

bse

numeric; the number of beta standard errors to utilize in constraining the beta grid limits. Beta grid is evaluated at β +/- bse*s.e.

lolim

numeric; the lower limit for the grid or the minimum value of the regression parameter β used to calculate the likelihood function.

hilim

numeric; the upper limit for the grid or the maximum value of the regression parameter β used to calculate the likelihood funciton.

multiThread

numeric; number of threads to use for parallel computing.

family

the link function for glm.

plinkCC

A boolean type that specifies how case/control are coded. case/control were coded 1/0 if it is FALSE, and were coded 2/1 if TRUE.

Details

This is a similar function to the main function evian. Instead of testing H0: β=0, it tests for whether H0:β \in (-c,c).

Value

This function outputs the row-combined the results from calculateGLR for each of the SNPs included in the data/bim files. The exact output for each SNP can be found in the calculateGLR documentation.

Note

When lolim/hilim is NOT defined, then the boundaries of the beta grid will be determined by the default bse=5, or a bse defined by the user. Otherwise, the user can define the exact beta grid boundaries using lolim/hilim.

In some cases the beta grid (using bse or lolim/hilim) may need to be increased substantially (bse as large as 15) if covariates are present in the formula. This is automatically dealt by the current function, but contribute to longer computation time to find the appropriate ranges. Estimation may become inaccurate with large number of correlated covariates, which is a known limitation of profile likelihoods.

See Also

calculateGLR

Examples

1
2
3
4
5
  data(evian_linear_raw)
  data(evian_linear_bim)
  rst2=glr(data=evian_linear_raw, bim=evian_linear_bim, xcols=10:ncol(evian_linear_raw),
             ycol=6, covariateCol=c(5,7:9), c=0.025,robust=F, model="additive",
             m=200, lolim=-0.6, hilim=0.6, multiThread=1,family='gaussian',plinkCC=FALSE)

evian documentation built on May 23, 2019, 5:02 p.m.

Related to glr in evian...