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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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