Calcite | Level 5

## Combining variables

Hello,

I would like to know to combine 2 variables into one. For instance, if we are talking about admission to colleges, one variable would be 'undergrad' and the other would be 'masters'. I want to combine all the yes and no's from 'undergrad' and 'masters' into one variable called 'admittance'. I then want to use 'admittance' to do a bi-variate comparison or logistical regression with another variable say 'gender' how would I do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Diamond | Level 26

## Re: Combining variables

What you said doesn't really seem to answer the question. We need to know your logic in determining whether Admittance gets a YES or a NO.

There are four cases:

```Undergrad        Masters          Admittance
YES                  NO                 ???
YES                  YES                ???
NO                    YES               ???
NO                    NO                ???```

Tell us what value you want for Admittance in each of the four cases.

--
Paige Miller
6 REPLIES 6
Diamond | Level 26

## Re: Combining variables

Can you tell us what values 'admittance' should have when we combine the YES and NO values in 'undergrad' and 'masters'?

--
Paige Miller
Calcite | Level 5

## Re: Combining variables

I would like 'yes' and 'no' for admittance results as well

Super User

## Re: Combining variables

Example Input;

Desired example output.

For all possible cases of your variables.

Also do you want a numeric or character result?

Calcite | Level 5

## Re: Combining variables

I would like 'yes' and 'no' for admittance results as well? w\Would there be an issue for a dis-coordinate  input?Say 'yes' to undergrad and no to 'masters'?

Diamond | Level 26

## Re: Combining variables

What you said doesn't really seem to answer the question. We need to know your logic in determining whether Admittance gets a YES or a NO.

There are four cases:

```Undergrad        Masters          Admittance
YES                  NO                 ???
YES                  YES                ???
NO                    YES               ???
NO                    NO                ???```

Tell us what value you want for Admittance in each of the four cases.

--
Paige Miller
Calcite | Level 5

## Re: Combining variables

```Undergrad        Masters          both Admittance
YES                  NO                 ???
YES                  YES                Yes
NO                    YES               ???
NO                    NO                ???```

in this case, 'admittance' needs to only represent people who got into both undergrad and masters

Discussion stats
• 6 replies
• 621 views
• 1 like
• 3 in conversation