library(NlsyLinks) #Load the package into the current R session.
dsOutcomes <- ExtraOutcomes79
dsOutcomes$SubjectTag <- CreateSubjectTag(subjectID=dsOutcomes$SubjectID,
generation=dsOutcomes$Generation)
dsDF <- CreatePairLinksDoubleEntered(outcomeDataset=dsOutcomes, linksPairDataset=Links79Pair,
outcomeNames=c("MathStandardized", "Weight", "WeightStandardized", "WeightStandardizedForAge19To25"))
estimatedAdultWeight <- DeFriesFulkerMethod3(
outcomeForSubject1=dsDF$WeightStandardizedForAge19To25_1,
outcomeForSubject2=dsDF$WeightStandardizedForAge19To25_2,
relatedness=dsDF$R)
# The HSquared and CSquared values should be 0.633936 and 0.006209162.
estimatedMath <- DeFriesFulkerMethod3(
outcomeForSubject1=dsDF$MathStandardized_1,
outcomeForSubject2=dsDF$MathStandardized_2,
relatedness=dsDF$R)
# The HSquared and CSquared values should be 0.8595078 and 0.03879863.
Run the code above in your browser using DataLab