In my analysis, I am using district-month panel data. I want to do the following many times: (1) select a bootstrap subsample from the data; (2) run a constrained regression that forces some coefficients to zero; (3) save the non-zero variables in a list. After all the iterations, I want a master list that contains the intersection of the selected variables over all the runs. The way I am currently envisioning the task is to: initiate an empty global, run the above steps in a for loop, in the loop compare the selected variables with the global and update it to hold the intersection.

I've tested it on the auto dataset with 3 iterations but the global list does not update. It seems the issue is when intersecting selected_vars with master_list (the part with the & operator). Is there a cleaner way to approach this? I tried making master_list a local but that produces an empty list as well. Thanks
Code:
sysuse auto.dta, clear
    
    
gl master_list ""
forvalues i = 1/3 {
    
    ** Subsample
    set seed 2468
    bsample
        
    ** Lasso
    set seed 1357 // For cross-validation
    lassoregress price mpg rep78 headroom trunk weight length turn displacement gear_ratio foreign
        
    ** Save selected variables
    local selected_vars "`e(varlist_nonzero)'"
        
    ** Update Master with intersection
    gl master_list: list master_list & selected_vars
        
    local dropped: list master_list - selected_vars
    local added: list selected_vars - master_list
        
    di "Added variables: " " `added' "
    di "Dropped variables: " " `dropped' "
    di "Support: " " $master_list "
 }

di " $master_list "