Coursera Assignment (Week 2)

Hello Friends!

This is the second week assignment of my Data management course from coursera.

Following is the program I wrote in SAS Studio to submit as a part of week2 home work.

LIBNAME mydata “/courses/d1406ae5ba27fe300″ access=readonly;
DATA new; set mydata.nesarc_pds;
LABEL S3AQ3B5=”frequency of chewing”
S3AQ8A6=”tried to stop more than once”
S3AQ8C4=”Happened before 12 months ago”;
/* These are the labels which denotes the variables I have used in this program */
IF S3AQ8C4=1;
/*subsetting data to include only consumers with more than 1 year of use*/
PROC SORT; BY IDNUM;
PROC SORT; by IDNUM;
PROC FREQ; TABLES S3AQ3B5 S3AQ8A6 S3AQ8C4 ;
RUN;

 

And following are the output tables of the program:

frequency of chewing
S3AQ3B5 Frequency Percent Cumulative
Frequency
Cumulative
Percent
Frequency Missing = 7118
1 247 33.24 247 33.24
2 34 4.58 281 37.82
3 62 8.34 343 46.16
4 95 12.79 438 58.95
5 57 7.67 495 66.62
6 238 32.03 733 98.65
9 10 1.35 743 100.00
tried to stop more than once
S3AQ8A6 Frequency Percent Cumulative
Frequency
Cumulative
Percent
1 5423 68.99 5423 68.99
2 2423 30.82 7846 99.81
9 15 0.19 7861 100.00
Happened before 12 months ago
S3AQ8C4 Frequency Percent Cumulative
Frequency
Cumulative
Percent
1 7861 100.00 7861 100.00

 Summary of the Tables:

1st Table:

  • A large number of people use to chew tobacco on daily basis (33%).
  • Also, a large group used to chew tobacco only once a month (32%) (variable 6)
  • Data of 7118 people is missing.

2nd Table:

  • About 69 % of people have tried to stop their habit but failed
  • ALL OF THESE RESULTS ARE EVALUATED ONLY FOR PEOPLE WHO HAVE STARTED THIS FOR MORE THAN 1 YEAR AS SHOWN BY TABLE3. (if condition)

 

Thanks!!

Kush

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s