Genotype-phenotype associations can be results of direct effects, genetic nurturing effects and population stratification confounding (The nature of nurture: Effects of parental genotypes, Science, 2018, Deconstructing the sources of genotype-phenotype associations in humans, Science, 2019). Genotypes from parents and siblings of the proband can be used to statistically disentangle these effects. To maximize power, a comprehensive framework for utilizing various combinations of parents’ and siblings’ genotypes is introduced. Central to the approach is mendelian imputation, a method that utilizes identity by descent (IBD) information to non-linearly impute genotypes into untyped relatives using genotypes of typed individuals. Applying the method to UK Biobank probands with at least one parent or sibling genotyped, for an educational attainment (EA) polygenic score that has a R^2 of 5.7% with EA, its predictive power based on direct genetic effect alone is demonstrated to be only about 1.4%. For women, the EA polygenic score has a bigger estimated direct effect on age-at-first-birth than EA itself.