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