Hello,
I am trying to obtain coefficients, bootstrap standard errors and percentile CI for an indirect effect using gsem. I saw this code online


Code:
 
 capture program drop boot1  
 program boot1, rclass  
 gsem (Y<- X1 i.X2 X3 Z P[province] C[province>district_no]) ///  
 (Z<-X1 i.X2 X3 P[province] C[province>district_no]), nocapslatent latent (P C)  
 return scalar X1_indirect=(_b[Z:X1]*_b[Y:Z])  
 return scalar X21_indirect=(_b[Z:1.X2]*_b[Y:Z])  
 return scalar X22_indirect=(_b[Z:2.X2]*_b[Y:Z])  
 return scalar X3_indirect=(_b[Z:X3]*_b[Y:Z])  
 end  
 bootstrap r(X1_indirect) r(X21_indirect) r(X22_indirect) r(X3_indirect), seed(12345) reps(200): boot1 estat boot, bc percentile
This works but it instead of just showing the outputs for X1_indirect, X21_indirect, and X3_indirect which it does now, I also want to see the output for these portions of the code

Code:
 
 gsem (Y<- X1 i.X2 X3 Z P[province] C[province>district_no]) ///  
 (Z<-X1 i.X2 X3 P[province] C[province>district_no]), nocapslatent latent (P C)
Could someone help me with how to edit the code in a way that it would show me the outputs for these section too?

Thanks in advance!