By Stuart G. Baker, 2015
Introduction
The latent class twin method assumes two types of latent classes: an environmental susceptibility (ES) latent class and a genetic susceptibility (GS) latent class. The GS latent class represents a genetic contribution (arising from an additive, autosomal dominant, or autosomal recessive model) associated with high probabilities of independent outcomes. The ES latent class involves background probabilities of possibly dependent outcomes. The latent class twin method estimates the genetic prevalence, which is the fraction of persons in the genetic susceptibility latent class, and the heritability fraction, which is the fraction of persons in the genetic susceptibility latent class with the trait or outcome.
Reference
Baker, SG. The latent class twin method.
Requirement
Mathematica Version 10 or later.
Set-Up
copy | all files into some folder called "FOLDER" |
---|---|
start | a new Mathematica session |
type | SetDirectory["FOLDER"] |
type | << twinfit.m |
To run computations in paper for breast cancer twin survival data
type | TwinFit[dataBem, parsym, MaxBoot->2000] |
---|
To run computations in paper for breast cancer twin data with sum of counts
type | TwinFit[dataBobs, parsym] |
---|
To try on your own data,
type | TwinFit[ dataset, parsym,options] |
---|
Options
Option | Default | Explanation |
---|---|---|
ModelList | "All" | All or create a list from "AD", "AR", "Add" |
NewFitQ | TRUE | New fitting or use stored result of previous fit |
CensoringStart | "during" | Censoring in relation to interval; other choice is "after" interval |
NumCatFinal | 1 | Number of intervals in final category |
AMin | 0.7 | Minimum outcome probability for GS latent class |
ShowPlot | FALSE | Profile plot of deviance versus s for different values of a |
ShowProgress | FALSE | Show progress in terms of profile of likelihood |
MaxBoot | 0 | Number of bootstrap iterations |
dataset={{m2,m1,m0,d2,d1,d0}},datatype,dataname,datafilename}
m2 | L x L matrix of incidence, incidence for MZ twins |
---|---|
m1 | L x L matrix of incidence, censoring for MZ twins |
m0 | L x L matrix of censoring, censoring for MZ twins |
d2 | L x L matrix of incidence, incidence for DZ twins |
d1 | L x L matrix of incidence, censoring for DZ twins |
d0 | L x L matrix of censoring, censoring for DZ twins |
datatype | "em" or "obs" . If datatype ="obs", m2,m1,m0, d2, d1,d0 are scalar |
datasetname | name of dataset |
datafilename | name used for files and plots |
parsym={a,b,c,s}
File Contents
Download All (ZIP, 41 KB)
File name | Description |
---|---|
twinfit.m | Calls other packages |
twinfitcore.m | Core computations |
twinfitprofille.m | Fits profile likelihood as a function of allele frequency s |
twinfitprofileplot.m | Plot of profile likelihood |
twinfitem.m | Fits survival data with EM algorithm |
twinfitprob.m | Probability of latent class and outcome given latent class |
twinfitfreq.m | Probability of genotype |
twinfitvar.m | Variance components method (for comparison) |
matrixlx.m | Matrix functions |
twinfitsummary.m | Summary report with bootstap |
twinfitcheck.m | TwinFitCheck[dataset,parysm] checks convergence (extra) |
twinfitsim.m | TwinFitSim[parsym] compare estimates under different amin (extra) |
twinfitheritability.m | TwinFitPlotH[] plots heritability versus heritability fraction (extra) |
Disclaimer
This code is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the NCI or the individual developers be liable for any claim, damages or other liability of any kind. Use of this code by recipient is at recipient's own risk. NCI makes no representations that the use of the code will not infringe any patent or proprietary rights of third parties.
Last updated: November 16, 2015