BookmarkSubscribeRSS Feed
berhard
Calcite | Level 5

I have a dataset with a series of six variables (coded 0 for no and 1 for yes) related to one question about water use. In the survey, participants were told to select as many responses as were applicable. How can I code this so I see what % of participants chose each response or no responses? I've been able to find the answer for coded data (cards) but not for imported data (from excel).

4 REPLIES 4
Kurt_Bremser
Super User

Once data has been imported into SAS, the source becomes irrelevant. Just adapt variable names, and you're good.

If you run into problems, post the code you already have, example data and what the result should look like.

berhard
Calcite | Level 5

Basically, this is what it looks like in the codebook. As you can see, there are 0 for no and 1 for yes, the variables I want to look at are coded as wat_del_ip through wat_del_or. I want to create a table similar to the one second picture here, but have only been able to find code for data cards and not imported data.


Screen Shot 2016-12-15 at 9.01.49 AM.png
berhard
Calcite | Level 5

Here's the codebook picture:


Screen Shot 2016-12-15 at 9.01.13 AM.png
Astounding
Opal | Level 21

Since you are working with 0/1 variables, and they are already separate variables, you won't need any examples related to a multilabel format.  A simple PROC TABULATE can handle this:

 

proc tabulate;

var wat_del_ip wat_del_or;

tables wat_del_ip wat_del_or, sum='N' mean*f=percent8.1;

run;

 

You can change the label for the word 'Mean' is you prefer.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 811 views
  • 1 like
  • 3 in conversation