Coursera Assignment (Week 4)

Hello Friends

I am feeling good today. Finally the course ends as I submit this last homework post to the coursera.

Following is the code for the week4 hw:

LIBNAME mydata “/courses/d1406ae5ba27fe300” access=readonly;
DATA new; set mydata.nesarc_pds;
LABEL S3AQ3B5=”frequency of chewing”
S3AQ8A6=”tried to stop more than once”
CHECK325=”tobacco use status”;
/* These are the labels which denotes the variables I have used in this program */
IF S3AQ3B5=9 THEN S3AQ3B5=.;
/* if frequency is unknown then put null */
IF S3AQ8A6=9 THEN S3AQ8A6=.;
/* IF unknown if tried to stop[ but coundn’t do it*/
if S3AQ3B5=1 then CHEWING_FREQ=1;
ELSE IF S3AQ3B5=2 THEN CHEWING_FREQ=5;
ELSE IF S3AQ3B5=3 THEN CHEWING_FREQ=4;
ELSE IF S3AQ3B5=4 THEN CHEWING_FREQ=2;
ELSE IF S3AQ3B5=5 THEN CHEWING_FREQ=3;
ELSE IF S3AQ3B5=6 THEN CHEWING_FREQ=6;
IF check325=2;
/*subsetting data to include only consumers with more than 1 year of use*/
PROC SORT; BY IDNUM;
PROC FREQ; TABLES CHEWING_FREQ S3AQ8A6 CHECK325;
proc GCHART; VBAR S3AQ8A6 CHEWING_FREQ/DISCRETE type=PCT WIDTH=5;
/*PROC UNIVARIATE; VBAR S3AQ3B5;*/
PROC GCHART; VBAR CHEWING_FREQ/discrete TYPE=MEAN SUMVAR=S3AQ8A6;
RUN;

 

Frequency Tables:

CHEWING_FREQ Frequency Percent Cumulative
Frequency
Cumulative
Percent
Frequency Missing = 28
1 386 29.83 386 29.83
2 203 15.69 589 45.52
3 109 8.42 698 53.94
4 114 8.81 812 62.75
5 52 4.02 864 66.77
6 430 33.23 1294 100.00
”tried to stop more than once”
S3AQ8A6 Frequency Percent Cumulative
Frequency
Cumulative
Percent
Frequency Missing = 4
1 576 43.70 576 43.70
2 742 56.30 1318 100.00
”tobacco use status”
CHECK325 Frequency Percent Cumulative
Frequency
Cumulative
Percent
2 1322 100.00 1322 100.00

 

Visualizations:

1

  1. S3AQ8A6 (863-NESARC)

These are the individuals who tried to stop/cut tobacco usage more than once but failed.

 

 

 

 

 

 

 

2

 

2. CHEWING_FREQ

This variable is a modified form of S3AQ3B5 (830-NESARC)

It shows the frequency of tobacco consumption.

 

 

 

 

3

 

3. This is the main finding of my project. Its shows independent variable (categorical) on x-axis and dependent  variable (categorical)  S3AQ8A6 on y-axis.

 

 

 

 

 

 

It can be concluded that inability to stop/cut tobacco chewing seems not to be significantly associated with the frequency of consumption. This data is for candidates chewing for more than 12 months (as check325 is set to 2)

 

Looking forward for feedback

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