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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.