BookmarkSubscribeRSS Feed
mandan414
Fluorite | Level 6

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

 

 

18 REPLIES 18
mandan414
Fluorite | Level 6

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

 

PaigeMiller
Diamond | Level 26

What is your question?

--
Paige Miller
mandan414
Fluorite | Level 6
Sorry I posted the question before finish it. i sent the full question right after that. thanks.
CurtisMackWSIPP
Lapis Lazuli | Level 10

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.

mandan414
Fluorite | Level 6

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! 

Reeza
Super User
If this was the supplied input, what would you expect as the output?
mandan414
Fluorite | Level 6

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

 

mandan414
Fluorite | Level 6
I mean the rates of derived variable of total task.
Reeza
Super User
Please show EXACTLY what is expected as output.
mandan414
Fluorite | Level 6

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

 

mandan414
Fluorite | Level 6
I want the rates for total of those tasks. As I said, i'd like to make a variable out of those 3 named total task. Then find out the rate of respondents for each categories of I (myself) vs sister vs both. Thanks.
mandan414
Fluorite | Level 6
let's say that respondent#1 answer 'I' for Var-1 'I' for var_2 and both for var-3, then respondent#2 replied sister for var_1, I for var_2 and I for var_3 and …. so on. I set thresholds for total (all responds for I, sister and both) and subtotal (all I or all sister or all both) and then put condition and make var_4 as total tasks with the categories of I, sister, myself, NA and NS.
Reeza
Super User

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

 


 

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 1463 views
  • 1 like
  • 5 in conversation