Skip to main content
. 2022 Apr 5;24(4):512. doi: 10.3390/e24040512
Algorithm 1: IV-GIN
 Input: Treatment X, outcome Y, and set of observed variables O .
 Output: Set of candidate C and its corresponding conditional set Conset .
  1: Initialize the set of candidate IVs: C= , the conditional set: Conset= , the length of conditional set: ConsetLen=0 , and Tag=O ;
  2: while ConsetLen<|Tag| do
  3:    for each variable ZiC  do
  4:     repeat
  5:         Select a subset W from OZi such that W=ConsetLen ;
  6:         if  [Z||W] follows the IV-GIN condition then
  7:           Add Zi into C , and delete Zi from Tag ;
  8:           Set Conset(Zi)=W ;
  9:           Break the repeat loop of line 4;
  10:         end if
  11:      until all subsets with length ConsetLen in O\Zi are selected;
  12:    end for
  13:     ConsetLen=ConsetLen+1 ;
  14: end while
  15: Return: C and Conset