SNPlm {FunctanSNP} | R Documentation |
Revised functional linear regression analysis for the sequence (genotypes) data
Description
This function models the genetic effect of genetic variants by relating the genetic variant function to the phenotype adjusting for covariates.
Usage
SNPlm(y, z, location, X, type1, type2, nbasis1, nbasis2, params1, params2,
intercept = FALSE, Plot = FALSE)
Arguments
y |
a numeric vector specifying the response variables. |
z |
a matrix specifying the scalar covariates, with the number of rows equal to the number of samples. |
location |
a numeric vector defining the sampling sites of the sequence data. |
X |
a matrix specifying the sequence data, with the number of rows equal to the number of samples. |
type1 |
a character specifying the type of the basis functions that constitutes the genetic variation function. The options are "Bspline", "Exponential", "Fourier", "Monomial", and "Power". |
type2 |
a character specifying the type of the basis functions that constitutes the genetic effect function. The options are "Bspline", "Exponential", "Fourier", "Monomial", and "Power". |
nbasis1 |
an integer specifying the number of basis functions that constitutes the genetic variation function. |
nbasis2 |
an integer specifying the number of basis functions that constitutes the genetic effect function. |
params1 |
in addition to rangeval1 (a vector of length 2 giving the lower and upper limits of the range of permissible values for the genetic variation function) and nbasis1, all bases have one or two parameters unique to that basis type or shared with one other; |
params2 |
in addition to rangeval1 (a vector of length 2 giving the lower and upper limits of the range of permissible values for the genetic effect function) and nbasis1, all bases have one or two parameters unique to that basis type or shared with one other;
|
intercept |
should intercept(s) be fitted (TRUE) or set to zero (default = FALSE). |
Plot |
should the estimated genetic effect function beta(t) be plotted (TRUE) or not (default = FALSE). |
Value
An "SNPlm" object that contains the list of the following items.
alpha: estimated intercept value.
gamma: estimated coefficients of the scalar covariates.
b: estimated coefficients of the chosen basis functions for the genetic effect function beta(t).
betat: an "fd" object, representing the estimated genetic effect function beta(t).
residuals: the residuals, that is response minus fitted values.
fitted.values: the fitted mean values.
terms: the terms object used.
model: if requested (the default), the model frame used.
para: some relevant parameters of "SNPlm" model.
See Also
See Also as SNPgvf
.
Examples
library(FunctanSNP)
n <- 300
m <- 30
simdata1 <- simData1(n, m, seed = 123)
y <- simdata1$y
z <- simdata1$z
location <- simdata1$location
X <- simdata1$X
SNPlmres <- SNPlm(y, z, location, X, type1 = "Bspline", type2 = "Bspline", nbasis1 = 5,
nbasis2 = 5, params1 = 4, params2 = 4, intercept = FALSE, Plot = TRUE)
SNPlmres$alpha
SNPlmres$gamma
SNPlmres$b