% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estimate.heritability.R
\name{estimate.heritability}
\alias{estimate.heritability}
\title{Estimates ACE, AE, CE, and E heritability models}
\usage{
estimate.heritability(
  myformula,
  data,
  DZ = "DZ",
  zyg = "ZYGOSITY",
  fid = "FID",
  checks.CI = TRUE
)
}
\arguments{
\item{myformula}{the model to be fit (trait ~ 1 + covariate)}

\item{data}{input data frame}

\item{DZ}{how dyzigotic twins are codified}

\item{zyg}{name of the column describing zygosities}

\item{fid}{name of the column describing family ID}

\item{checks.CI}{whether to check if the best model CI includes the zero, and the next model should be chosen instead}
}
\value{
a list with the following R objects:
, models, a list of the heritability summary stats for each tested model, that is:
, models$ACE, the results of the ACE model
, models$AE, the results of the AE model
, models$CE, the results of the CE model
, models$E, the results of the E model
, aics, AICs of all fitted models
, best, label for best model (ACE, AE, CE, E)
, estimate.best, the summary stats and CI for the best model
, note, whether a next-best model has been used (empty if check.CI is FALSE)
}
\description{
Estimate the contribution of additive genetic (A), shared (C) and individual-specific 
environment (E) effects on traits variations, using a classical twin design study. 
It fits ACE, and the most parsimonious AE, CE e E model, which are then compared using 
the Akaikeâ€™s information criterion (AIC). The best (lowest AIC) model is then selected.
If checks.CI is set, when selecting the best model, the functions also checks that the
confidence intervals (CI) do not include the zero -- if they do, the next best nodel is
selected and a note is returned.
}
\author{
Alessia Visconti
}
