DATA Step, Macro, Functions and more

create a variable that multiply two categorical variables

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
Accepted Solution

create a variable that multiply two categorical variables

I have the following dataset

 

id    out1          out2
1     a                  b
2    c                   d

I want to create a variable out3 that multiple the categorical variables into1:

   

id    out1          out2     out3
1     a                  b       a.b
2    c                   d      c.d

Accepted Solutions
Solution
‎10-12-2016 01:19 PM
Super User
Posts: 10,500

Re: create a variable that multiply two categorical variables

Do you mean something like

 

out3 = catx('.',out1, out2);

 

or do expect a numeric result?

View solution in original post


All Replies
Solution
‎10-12-2016 01:19 PM
Super User
Posts: 10,500

Re: create a variable that multiply two categorical variables

Do you mean something like

 

out3 = catx('.',out1, out2);

 

or do expect a numeric result?

Frequent Contributor
Posts: 110

Re: create a variable that multiply two categorical variables

Yes. Categorical, Thank you! 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 212 views
  • 0 likes
  • 2 in conversation