Dear all,

I am trying to model the causal effects of R&D on innovation output and of innovation output on labor productivity at the firm level. My model identifies R&D as a function of some facility and sector characteristics, innovation output as a function of R&D along with additional attributes, and labor productivity as a function of innovation output along with additional attributes. The stata command I am using for the Generalized Structutal Equation Model (GSEM) is below. Both R&D and innovation output are binary variables.

My question is: How can I treat both R&D and innovation output as latent variables while I actually observe them? I would like to extract the propability of engaging in R&D from the first equation and use it as a latent variable in the second equation (innovation output equation). Similarly, I would like to extract the the propability of having innovation output from the second equation and use it as a latent variable in the third equation (labor productivity equation). Is this feasible using GSEM? The aim is to overcome any selection bias.

Code:
gsem (employment skillfulness foreign_ownership i.subsector i.country_dummy -> RandD, family(bernoulli) link(logit)) ///
    (i.RandD employment skillfulness foreign_ownership i.subsector i.country_dummy technology_used capital_intensity -> innov, family(bernoulli) link(logit)) ///
    (i.innov employment skillfulness foreign_ownership i.subsector i.country_dummy capital_intensity material fuel_intensity -> tfprYKLM) ///
    , vce(robust) nocapslatent
Thank you in advance.