Skip to main content
. Author manuscript; available in PMC: 2021 Mar 11.
Published in final edited form as: Biometrics. 2020 Dec 8;77(1):9–22. doi: 10.1111/biom.13392

Algorithm 2.

Estimating ψ0,s using V-fold cross fitting

1: Choose a technique to estimate the conditional means μ0 and μ0,s;
2: Generate a random vector Bn ∈ {1,…, V}n by sampling uniformly from {1,…, V} with replacement, and denote by Dj the subset of observations with index in {i :Bn,i = j} for j = 1,…, V.
3: for υ = 1,…, V do
4: μυ ← Regress Y on X using the data in ∪j≠υDj using the technique from step (1) to estimate μ0
5: μ^s,υ ← Regress μ^υ(X) on Xs using the data in ∪j≠υDj to estimate μ0,s;
6: ψ^n,SυiDj{Yiμ^s,υ(Xi)}2iDj{Yiμ^υ(Xi)}2iDj(YiY¯n)2, as in Equation (10);
7: end for
8: ψ^n,scv1Vυ=1Vψ^n,sυ.