LTMH with some examples.tmvtnorm, parallel and MASS.# LTMH for random sample
LTMH(model,data,init_beta=NULL,init_h2,V,famid,prev,max.iter=100,max.sub.iter=50,n.cores=1)
# LTMH for ascertained sample
LTMH.asc(model,data,init_beta=NULL,init_h2,V,famid,prev,max.iter=100,n.cores=1,proband)
formula which is a symbolic description of the model to be fitted.model. Dependent variable in the model should be coded as 0 and 1 for unaffected and affected subjects, repelctively.NULL were provided, coefficient estimates of a probit model obtained from glm.# CEST for heritability
CEST.h2(model,data,init_beta=NULL,V,famid,prev,n.cores=1,proband=NULL)
# CEST for beta
CEST.beta(model,data,test.beta,init_h2,V,famid,prev,max.iter=100,n.cores=1,proband=NULL)
formula which is a symbolic description of the model to be fitted.model. Dependent variable in the model should be coded as 0 and 1 for unaffected and affected subjects, repelctively.NULL were provided, coefficient estimates of a probit model obtained from glm.NULL.# Generating nuclear families with a one main genetic effect (SNP)
genNucFam(totalfam,num.fammem=c(3,4,5,6),prob.fammem=c(0.2,0.3,0.3,0.2),MAF,h2,ha2,prev,n.cores=1)
num.fammem. Each element should be ranged in from 0 to 1 and its summation should be equal to 1. Default is c(0.2,0.3,0.3,0.2).LTMH and LTMH.asc return an object of class list containing the following compoenents:
beta_std : Coefficient estimates for standardized covariates.beta_unstd : Coefficient estimates for unstandardized covariates. Even if you do not include the intercept in your model, the intercept will be always included.h2 : Heritability estimates.n_iter : Number of iterations of EM.CEST.h2 and CEST.beta return an object of class data.frame containing the following columns:
Score : Score estimate.var_Score : Variance of Score.Chisq : Chi-squared statistics.DF : Degree of freedom of Chi-square distribution.Pvalue : P-value of Chi-square statistics.Random_sp.txt : Datasets for 500 families which are randomly selected.Random_kinship.txt : Kinship coefficients matrix for 500 families which are randomly selected.## We recommend to run following example on device which can use multiple CPUs. It takes much time.
source("LTMH_Sourcecode.R")
dataset <- read.table("Random_sp.txt",head=T,stringsAsFactor=F)
V <- as.matrix(read.table("Random_kinship.txt",head=F))
LTMH(model=Y~snp-1,
data=dataset,
init_h2=0.2,
V=V,
famid=dataset$FID,
prev=0.1)
CEST.h2(model=Y~snp-1,
data=dataset,
init_beta=NULL,
V=V,
famid=dataset$FID,
prev=0.1)
Ascertained_sp.txt : Datasets for 500 families with affected proband.Random_kinship.txt : Kinship coefficients matrix for 500 families with affected proband.## We recommend to run following example on device which can use multiple CPUs. It takes much time.
source("LTMH_Sourcecode.R")
dataset <- read.table("Ascertained_sp.txt",head=T,stringsAsFactor=F)
V <- as.matrix(read.table("Random_kinship.txt",head=F))
LTMH.asc(model=Y~snp-1,
data=dataset,
init_h2=0.4,
V=V,
famid=dataset$FID,
prev=0.1,
proband=dataset$ind)
CEST.h2(model=Y~snp-1,
data=dataset,
init_beta=NULL,
V=V,
famid=dataset$FID,
prev=0.1,
proband=dataset$ind)