Hello,
I have 3 variable in my dataset like these:
var_1 cleaning house Var_2 washing dishes Var_3 cooking
I 1 I 1 I 1
sister 2 sister 2 sister 2
both 3 both 3 both 3
NA 6 NA 6 NA 6
NS 9 NS 9 NS 9
I would like to make a derived variable of total task and find out who is doing more tasks overall.
Thank you
Hello,
I have 3 variable in my dataset like these:
var_1 cleaning house Var_2 washing dishes Var_3 cooking
I 1 I 1 I 1
sister 2 sister 2
brother 3 brother 3
NA 6 NA 6
NS 9 NS 9
What is your question?
Sorry if I am being dense here, but your data makes no sense. You say you have three variables, but list 6. You refer to a concept of "who" but only the word "sister" matches that description.
Var_1 Var_2 Var_3 each has 5 reply categories: I (myself), sister, both, NA (not applicable) and NS (not stated). Let's say that i have 1000 respondents and i want to see out of these 1000 what the rates are for myself vs sister vs both. Thank you!
I have these 3 variables in my dataset. I wants to create a derived variable out of these 3 as total task like this:
Var_4 total task
I 1
sister 2
both 3
NA 6
NS 9
I have these 3 variables in my dataset. I wants to create a derived variable out of these 3 as total task like this:
Var_4 total task
I 1
sister 2
both 3
NA 6
NS 9
You already have those in your original dataset.
Using proc freq is one way
proc freq data=have;
table variableName;
freq task;
run;
@mandan414 wrote:
I have these 3 variables in my dataset. I wants to create a derived variable out of these 3 as total task like this:
Var_4 total task
I 1
sister 2
both 3
NA 6
NS 9
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.