I am working on creating dummy variables for emails. In this data set there is the email (email1) and then whether they opened email1 (email1_email_opened) and then whether they clicked on a call to action link in the email (email1_email_clicked). When creating these dummy variables for the three original variables I don't want there to be a 0 for the email opened dummy if they did not receive it. Same thing with the clicking on it variable. This would be misrepresentation and could lead to incorrect results. Below is the code that I have so far, however it is not running as I would like. It is still outputting a 0 for email1_email_opened when email1 was 0. I should also note that when I don't want to have a misrepresentation, I am looking to place a '.' there. So this would make the variable a character variable. Maybe that is what is going wrong, but I have been working on this for hours. I have also attached a sample of the dataset to farther help understand this question. if email1 = 'Y' then email1_Dummy = '1'; else email1_Dummy = '0'; if email1_dummy = '0' then email1_EMAIL_OPENED_dummy = '.' and email1_Click_dum = '.'; if email1_EMAIL_OPENED = 'Y' then email1_EMAIL_OPENED_dummy = '1'; else email1_EMAIL_OPENED_dummy = '0'; if email1_EMAIL_OPENED_dummy = '0' then email1_click_dum = '.'; if email1_EMAIL_CLICKED = 'Y' then email1_click_dum = '1'; Sample Dataset: email1 email1_email_opened email1_email_clicked Y Y N N N N N N N Y N N
... View more