Learn R Programming

GxM (version 1.1)

GxM: Maximum Likelihood Estimation of Gene-by-Measured Environment Interaction Models

Description

This function is used to produce maximum likelihood estimation for model fittings. With identification of the model fitted to the given data set with certain constrains of parameters, both numerical method and closed form based method are available to obtain the maximum likelihood estimate of parameters. Hessian matrix of log-likelihood at the estimate is provided to obtain the standard errors of the estimate.

Usage

GxM(dataset, rGvalue=0.995, modelname, 
    zeroset=character(), closedform=FALSE, K=8, coreNumber=1, 
    manualinitial=NULL, priority=1, gradientlevel=2)

Arguments

dataset
a data frame of input. This data frame should contain 6 columns, including the id of twin/sibling pairs, the rG value for the pairs, as well as the observed M1, M2, P1 and P2 values. The M1, M2, P1, P2 data would NOT be automatically standardized.
rGvalue
a correlation value of genetic influences to a pair of twins/siblings. A value close to one is used to replace exact one to avoid calculations with singular matrices. This value cannot be the same for all pairs for the same reason.
modelname
a character string input specifying which model should be fitted. Possible choices include Chol,CholGxM,CholNonLin,NLMainGxM,CorrGxM and CorrNonLin. [object Object],[object Object],[object Object],[object Object],[object Object]

Value

  • An S4 class of output with 10 slots would be returned.
  • loglikelihoodmaximum log-likelihood value from fitting indicated model to the input data set.
  • BICBayesian information criterion (BIC) value from the model fitting.
  • parparameter estimates.
  • hessHessian matrix of log-likelihood at the maximum point with respect to parameters.
  • gradientgradient components of log-likelihood at the maximum point with respect to parameters.
  • modelnameinherited from input.
  • zerosetinherited from input.
  • closedforminherited from input.
  • Kinherited from input.
  • coreNumberinherited from input.

item

  • zeroset
  • closedform
  • K
  • coreNumber
  • manualinitial
  • priority
  • gradientlevel

References

Rathouz, P. J., Van Hulle, C. A., Rodgers, J. L., Waldman, I. D., Lahey, B. B. (2008) Specification, testing, and interpretation of gene-by-measured-environment interaction models in the presence of gene-environment correlation. Behavior Genetics, 38(3), 301-315.

See Also

checkGxM, summaryGxM

Examples

Run this code
id <- 1:10;
rG <- c(rep(1,5),rep(0.5,5));
M1 <- rnorm(10);
M2 <- rnorm(10);
P1 <- rnorm(10);
P2 <- rnorm(10);
Data <- data.frame(id,rG,M1,M2,P1,P2);
output <- GxM(dataset = Data, modelname='Chol', closedform=TRUE);
output;
output@BIC;
output@hess;

Run the code above in your browser using DataLab