sing survey data in the following arrangement:

Group: Firm_investment
Q1 - each question has 1,2,3, 4 - four options, option 4 is non-investment (below)

Group: Firm_noninvestment
Q1 - option 4

Q1 is a filter question that decides whether a firm invested or not. However, Q1 is broken down into 4 variables (Q1a, Q1b, Q1c, Q1d)

Then I would like to compare firms that invested vs non-invested, based on their sales, wages, profit (each a variable in the dataset).

The methodology I've tried does not work (mostly because it a SAS methodology).
Create a flag (1,0) for investment (Q1a!=4 & Q1b!=4 & Q1c!=4 & Q1d!=4, else flag=0) vs non-investment (Q1==4)

FYI: SAS equivalent (ˆ=not equal)
if Q1aˆ=4 and Q1bˆ=4 and Q1cˆ=4 and Q1dˆ=4, then Flag=1,
else Flag=0

Then, calculate mean flag==1 and sales, flag==1 and wages, and flag==1 and profits vs flag==2 and sales, flag==2 and wages, and flag==2 and profits

I hope this made sense

Could you guide my methodology and help me with the coding

Thank you in advance