The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » GENERAL SMOKING PREVALENCE IN RWANDA
GENERAL SMOKING PREVALENCE IN RWANDA [message #11819] Tue, 14 February 2017 04:43 Go to next message
Francois is currently offline  Francois
Messages: 9
Registered: February 2017
Location: KIGALI
Member
I do have a question about the General prevalence of Smoking in Rwanda( DHS 2014/2015)
Referencing to Tab 3.8.1 ( for women, using IR) and 3.8.2 (for men, using MR), we do fail to have the General prevalence of Smoking in Rwanda
Either by separate products and the general smoking in general.
Your assistance in coding or producing the results with codes will be highly helpful
and much appreciated !

Thanks
Francois


AF
Re: GENERAL SMOKING PREVALENCE IN RWANDA [message #11820 is a reply to message #11819] Tue, 14 February 2017 08:34 Go to previous messageGo to next message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
Hi,

Please check out the example on the attachment. I hope it helps
Re: GENERAL SMOKING PREVALENCE IN RWANDA [message #11853 is a reply to message #11819] Mon, 20 February 2017 18:52 Go to previous messageGo to next message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
Hi, I figured out how to compute "Other tobacco"

See Stata code below using Rwanda 2014-15 as an example...

** Rwanda: Standard DHS, 2014-15

// WOMEN'S FILE

********************************************************************************

*** YEAR = 2014-15
** PREVALENCE OF SMOKING

********************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000

********************************************************************************

** SURVEY SET
gen psu =    v021
gen strata = v022

svyset psu [pw = weight], strata(strata) vce(linearized)

*******************

** SVYDESCRIBE 
/* This checks whether or not your svyset agrees with what has been published 
on the country's DHS report */

//svydescribe

********************************************************************************

// RENAME

rename v013 age
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 province
rename sdistrict district

*==============================================================================*
// EDUCATION RECODE
recode education (0=0 "No education") (1=1 "Primary") ///
(2/3=2 "Secondary/higher"), gen(education_recode)
label var education_recode "Recode for education"
label val education_recode education_recode

*==============================================================================*

// SMOKING INDICATORS //

** CIGARETTES
recode v463a (. 0 9 = 0 "No") (1 = 1 "Yes"), gen(cigarettes)
label var cigarettes "Smokes cigarettes"
label val cigarettes cigarettes

*==============================================================================*

** PIPE
recode v463b (0 9 = 0 "No") (1 = 1 "Yes"), gen(pipe)
label var pipe "Smokes pipe"
label val pipe pipe

*==============================================================================*

** OTHER TOBACCO

gen other_tobacco	=	0
label define other_tobacco 0"No" 1"Yes"
label var other_tobacco "Uses/smokes other tobacco"
label val other_tobacco other_tobacco

** OTHER TOBACCO

foreach xvar of varlist 463c 463d 463x {
replace other_tobacco=1 if `xvar'==1
}


*==============================================================================*

** DOES NOT USE TOBACCO
recode v463z (0 9 =0) (1=1 "Not smoking"), gen(does_not_use_tobacco)
label var does_not_use_tobacco "Does not use tobacco products"
label val does_not_use_tobacco does_not_use_tobacco

*==============================================================================*

** DROP IF NOT WITHIN SAMPLE
qui regr cigarettes pipe other_tobacco does_not_use_tobacco  [pw=weight]		
drop if e(sample)!=1		/* drop observations with missings on any variable to be used in analysis */

********************************************************************************
** CHECK
svy: tab cigarettes, count format(%4.0f)
svy: tab cigarettes, percent format(%4.1f)

svy: tab pipe, count format(%4.0f)
svy: tab pipe, percent format(%4.1f)


svy: tab other_tobacco, count format(%4.0f)
svy: tab other_tobacco, percent format(%4.1f) 


svy: tab does_not_use_tobacco, count format(%4.0f)
svy: tab does_not_use_tobacco, percent format(%4.1f)

********************************************************************************
Re: GENERAL SMOKING PREVALENCE IN RWANDA [message #11854 is a reply to message #11853] Mon, 20 February 2017 18:53 Go to previous message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
In case you are using SPSS

Smoking prevalence in Rwanda 2014-15 ... Women's file

** OPEN THE SPSS (DHS MEN'S) DATASET AND THEREAFTER OPEN THIS SPSS SYNTAX
** RIGHT-CLICK, AND SELECT RUN ALL
** OR YOU CAN "HIGHLIGHT" EACH STEP AND THEN "RIGHT-CLICK" AND SELECT "RUN SELECTION"

** IN ORDER TO FULLY REPLICATE THE TABLES IN THE DHS REPORT, IT IS BEST TO USE COMPLEX SURVEY ANALYSIS 
WHICH IS EQUIVALENT TO SURVEYSET IF YOU WERE USING STATA **

**===========================================================================*

* CHANGE PATH BELOW TO THE PARTICULAR FOLDER WHERE YOUR SPSS DATA IS LOCATED
** (create a folder under "MY DOCUMENTS" and save it as "RWANDA - 2014-15 DHS"), then where Dubile appears, change to your Computer name
** To get your Computer name: click on "My Computer / Computer", then right-click ==> "Properties" ==> "Computer description = your computer name

GET
  FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\RWMR70FL.SAV'.
DATASET NAME DataSet1 WINDOW=FRONT.

***************************************************************************************************************************

* WEIGHT VARIABLE

COMPUTE weight=mv005 / 1000000.
VARIABLE LABELS  weight 'wgt'.
EXECUTE.

*=============================================================================*

** EDUCATION RECODE

RECODE MV106 (0=0) (1=1) (2 thru 3=2) INTO education.
VALUE LABELS education 0"No education" 1"Primary" 2"Secondary/higher".
VARIABLE LABELS  education 'Recode for education.'.
EXECUTE.

** AGE 50-59 YEARS OLD

RECODE MV012 (15 THRU 49 = 0) (50 THRU 59 = 1)  INTO aged_50to59.
VALUE LABELS aged_50to59 0"15-49" 1"50-59".
VARIABLE LABELS  aged_50to59 'Persons aged 50-59 years.'.
EXECUTE.

/***************************************************************************************************************************/

** COMPLEX SURVEY ANALYSIS - EQUIVALENT OF SURVEYSET
** change Dubile to your computer name

CSPLAN ANALYSIS
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /PLANVARS ANALYSISWEIGHT=weight
  /SRSESTIMATOR TYPE=WOR
  /PRINT PLAN
  /DESIGN STRATA=mv022 CLUSTER=mv021
  /ESTIMATOR TYPE=WR.


 *** DERIVING VARIABLE = SMOKING CIGARETTES 

RECODE MV463A (1=1) (0=0) (9=0) (ELSE=0) INTO cigarettes.
VALUE LABELS cigarettes 0"No" 1"Yes".
VARIABLE LABELS  cigarettes 'Smokes cigarettes.'.
EXECUTE.

/***************************************************************************************************************************/

* CHECK IF CORRECT USING COMPLEX SURVEY FREQUENCIES (should be the same as in the report)

** TABLE

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=cigarettes
  /CELLS POPSIZE TABLEPCT
  /STATISTICS SE CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** CROSSTAB CIGARETTES WITH AGE GROUP - from the output, your percentage is named "estimate" with the %

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
     /TABLES VARIABLES=MV013 BY cigarettes
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

/***************************************************************************************************************************/

 *** DERIVING VARIABLE = SMOKING PIPE

RECODE MV463B (1=1) (0=0) (9=0) (ELSE=0) INTO pipe.
VALUE LABELS pipe 0"No" 1"Yes".
VARIABLE LABELS  pipe 'Smokes pipe.'.
EXECUTE.

* CHECK IF CORRECT USING COMPLEX SURVEY FREQUENCIES (should be the same as in the report)

** TABLE

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=pipe
  /CELLS POPSIZE TABLEPCT
  /STATISTICS SE CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** CROSSTAB PIPE WITH AGE GROUP  - from the output, your percentage is named "estimate" with the %

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=MV013 BY pipe
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

/***************************************************************************************************************************/

 *** DERIVING VARIABLE = OTHER TOBACCO

COMPUTE other_tobacco = 0.
if MV463C = 1  or MV463D  = 1 or MV463X  =  1  other_tobacco = 1.
if MV463C NE 1 and MV463D  NE 1 and MV463X  NE  1  other_tobacco = 0.
value labels other_tobacco 0 "No" 1 "Yes".
VARIABLE LABELS other_tobacco 'Uses/smokes other tobacco'.
EXECUTE.

* CHECK IF CORRECT USING COMPLEX SURVEY FREQUENCIES (should be the same as in the report)

** TABLE

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=other_tobacco
  /CELLS POPSIZE TABLEPCT
  /STATISTICS SE CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** CROSSTAB PIPE WITH AGE GROUP  - from the output, your percentage is named "estimate" with the %

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=MV013 BY other_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** This part calculates the last three row of Table 3.8.2 **

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=aged_50to59 BY other_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

 *** DERIVING VARIABLE = DOES NOT USE/SMOKE TOBACCO

RECODE MV463Z (1=1) (0=0) (9=0) (ELSE=0) INTO does_not_use_tobacco.
VALUE LABELS does_not_use_tobacco 0"No" 1"Yes".
VARIABLE LABELS  does_not_use_tobacco 'Does not use/smoke tobacco products.'.
EXECUTE.

* CHECK IF CORRECT USING COMPLEX SURVEY FREQUENCIES (should be the same as in the report)

** TABLE

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=does_not_use_tobacco
  /CELLS POPSIZE TABLEPCT
  /STATISTICS SE CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** CROSSTAB PIPE WITH AGE GROUP  - from the output, your percentage is named "estimate" with the %

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=MV013 BY does_not_use_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

** This part calculates the last three row of Table 3.8.2 **

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=aged_50to59 BY does_not_use_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.


save outfile 'C:\Users\Dubile\Desktop\MAPS\RWANDA_MEN_ANALYSIS.sav'.

**///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////**

** ANALYSIS FOR ONLY MEN AGED 15-49 YEARS

***** RESTRICT - (SELECT CASES)

USE ALL.
COMPUTE filter_$=(MV012 >= 15 & MV012 <= 49).
VARIABLE LABELS filter_$ 'MV012 >= 15 & MV012 <= 49 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*** CROSSTABS

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=education BY cigarettes
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.


CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=education BY pipe
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.


CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=education BY other_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

CSTABULATE
  /PLAN FILE='C:\Users\Dubile\Documents\RWANDA - 2014-15 DHS\Plan1.csaplan'
  /TABLES VARIABLES=education BY does_not_use_tobacco
  /CELLS POPSIZE ROWPCT
  /STATISTICS CIN(95)
  /MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

Previous Topic: Datasets on Polygyny
Next Topic: Difference dataset household member recode and household recode
Goto Forum:
  


Current Time: Wed Dec 25 13:51:32 Coordinated Universal Time 2024