Learn R Programming

NlsyLinks (version 1.200)

Ace: Estimates the heritability of additive traits using a single variable.

Description

An ACE model is the foundation of most Behavior Genetic research. It estimates the additive heritability (with a), common environment (with c) and unshared heritability/environment (with e).

Usage

AceUnivariate(method=c("DeFriesFulkerMethod1","DeFriesFulkerMethod3"), dataSet, oName_1, oName_2, 
  rName="R", manifestScale="Continuous")
  
DeFriesFulkerMethod1(dataSet, oName_1, oName_2, rName="R")

DeFriesFulkerMethod3(dataSet, oName_1, oName_2, rName="R")

Arguments

method
The specific estimation technique.
dataSet
The data.frame that contains the two outcome variables and the relatedness coefficient (corresponding to oName_1, oName_2, and rName)
oName_1
The name of the outcome variable corresponding to the first subject in the pair. This should be a character value.
oName_2
The name of theoutcome variable corresponding to the second subject in the pair. This should be a character value.
rName
The name of the relatedness coefficient for the pair (this is typically abbreviated as R). This should be a character value.
manifestScale
Currently, only continuous manifest/outcome variables are supported.

Value

  • Currently, a list is returned with the arguments HSquared, CSquared, ESquared, and RowCount. In the future, this may be changed to an S4 class.

Details

The AceUnivariate function is a wrapper that calls DeFriesFulkerMethod1 or DeFriesFulkerMethod3. Future versions will incorporate methods that use latent variable models.

References

Rodgers, Joseph Lee, & Kohler, Hans-Peter (2005). Reformulating and simplifying the DF analysis model. http://www.springerlink.com/content/n3x1v1q282583366/{Behavior Genetics, 35 (2), 211-217}.

Examples

Run this code
library(NlsyLinks) #Load the package into the current R session.
dsOutcomes <- ExtraOutcomes79
dsOutcomes$SubjectTag <- CreateSubjectTag(subjectID=dsOutcomes$SubjectID,
  generation=dsOutcomes$Generation)
dsLinks <- Links79Pair
dsLinks <- dsLinks[dsLinks$RelationshipPath=='Gen2Siblings', ] #Use only the Gen2 Siblings (ie, NLSY79-C subjects)
dsDF <- CreatePairLinksDoubleEntered(outcomeDataset=dsOutcomes, linksPairDataset=dsLinks, 
  outcomeNames=c("MathStandardized", "HeightZGenderAge", "WeightZGenderAge"))

estimatedAdultHeight <- DeFriesFulkerMethod3(
  dataSet=dsDF,    
  oName_1="HeightZGenderAge_1", 
  oName_2="HeightZGenderAge_2")  
estimatedAdultHeight #ASquared and CSquared should be 0.606 and 0.105 for this rough analysis.

estimatedMath <- DeFriesFulkerMethod3(
  dataSet=dsDF,    
  oName_1="MathStandardized_1", 
  oName_2="MathStandardized_2")
estimatedMath #ASquared and CSquared should be 0.878 and 0.048.

class(GetDetails(estimatedMath))
summary(GetDetails(estimatedMath))

Run the code above in your browser using DataLab