MEDIA EXPOSURE VARIABLE [message #14621] |
Mon, 23 April 2018 05:39 |
Mlue
Messages: 92 Registered: February 2017 Location: North West
|
Senior Member |
|
|
Here's how I compute the MEDIA EXPOSURE VARIABLE(S): BANGLADESH DHS 2014 AS AN EXAMPLE
I use the Individual Recode file
/** FOR SAS **/
/** FOR TABLE 3.4 EXPOSURE TO MASS MEDIA **/
/*********************************************************************************/
/** ACCESS TO MASS MEDIA **/
DATA MASS_MEDIA_BDHS14;
SET BDHS.BDIR72FL; /* USED THE LIBNAME TO CALL DATA INTO SAS */
WEIGHT = (v005 / 1000000);
psu = v021;
strata = v023;
FORMAT news_once$6. watch_tv$6. listen_radio$6. all_media$6. no_media$6.;
/** READING NEWSPAPERS (at least once a week) **/
IF v157 in(2:3) THEN news_once = "1. Yes";
IF v157 not in(2:3) THEN news_once = "0. No";
/** WATCHES TV (at least once a week) **/
IF v159 in(2:3) THEN watch_tv = "1. Yes";
IF v159 not in(2:3) THEN watch_tv = "0. No";
/** LISTENS TO THE RADIO (at least once a week) **/
IF v158 in(2:3) THEN listen_radio = "1. Yes";
IF v158 not in(2:3) THEN listen_radio = "0. No";
/** ACCESSES ALL THREE MEDIA (at least once a week) **/
IF news_once = "1. Yes" & watch_tv = "1. Yes" & listen_radio = "1. Yes" then all_media="1. Yes";
ELSE all_media="0. No";
/** NO ACCESS TO ALL THREE MEDIA **/
IF news_once = "1. Yes" or watch_tv = "1. Yes" or listen_radio = "1. Yes" then no_media="0. No";
ELSE IF news_once = "0. No" or
watch_tv = "0. No" or
listen_radio = "0. No" then no_media= "1. Yes";
PROC TEMPLATE;
EDIT BASE.FREQ.CROSSTABFREQS;
EDIT FREQUENCY;
FORMAT=BEST12.;
END;
END;
RUN;
PROC FREQ DATA=WORK.MASS_MEDIA_BDHS14;
WEIGHT WEIGHT;
*TITLE "NUMBERS ONLY";
TABLE news_once watch_tv listen_radio all_media no_media;
TABLE v013 * news_once /NOCOL NOROW NOPERCENT;
*TABLE v013 * watch_tv /NOCOL NOROW NOPERCENT;
*TABLE v013 * listen_radio /NOCOL NOROW NOPERCENT;
*TABLE v013 * all_media /NOCOL NOROW NOPERCENT;
*TABLE v013 * no_media /NOCOL NOROW NOPERCENT;*/
RUN;
************************************************************ *******************************************************
/** FOR SPSS**/
/** BANGLADESH DHS 2014 **/
/** FOR TABLE 3.4 EXPOSURE TO MASS MEDIA **/
** USING SPSS
/*************************************************************************************************************/
/** ACCESS TO MASS MEDIA **/
COMPUTE weight = (v005 / 1000000).
COMPUTE psu = v021.
COMPUTE strata = v023.
WEIGHT BY weight.
** READING NEWSPAPERS (at least once a week).
RECODE v157 (2 THRU 3=1) (ELSE=0) INTO news_once.
VARIABLE ATTRIBUTE news_once "Reads a newspaper at least once a week?".
VALUE LABELS news_once 0 "No" 1 "Yes".
** WATCHES TV (at least once a week).
RECODE v159 (2 THRU 3=1) (ELSE=0) INTO watch_tv.
VARIABLE ATTRIBUTE watch_tv "Watches television at least once a week?".
VALUE LABELS watch_tv 0 "No" 1 "Yes".
** LISTENS TO THE RADIO (at least once a week).
RECODE v158 (2 THRU 3=1) (ELSE=0) INTO listen_radio.
VARIABLE ATTRIBUTE listen_radio "Listens to the radio at least once a week?".
VALUE LABELS listen_radio 0 "No" 1 "Yes".
** ACCESSES ALL THREE MEDIA (at least once a week).
COMPUTE all_media=0.
IF news_once = 1 & watch_tv = 1 & listen_radio = 1 all_media=1.
VARIABLE ATTRIBUTE all_media "Accesses all three media at least once a week?".
VALUE LABELS all_media 0 "No" 1 "Yes".
** NO ACCESS TO ALL THREE MEDIA.
COMPUTE no_media=1.
IF news_once = 1 OR watch_tv = 1 OR listen_radio = 1 no_media=0.
VARIABLE ATTRIBUTE no_media "Accesses none of the three media at least once a week?".
VALUE LABELS no_media 0 "No" 1 "Yes".
/********************************************************************************************************************/
** CHECK.
FREQUENCIES VARIABLES=news_once watch_tv listen_radio all_media no_media
/ORDER=ANALYSIS.
CROSSTABS
/TABLES=V013 v190 BY no_media
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.
CROSSTABS
/TABLES=V013 BY news_once
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.
************************************************************ *********************************************************
/** FOR Stata**/
/*
INDIVIDUAL RECODE: BDIR72FL
BDHS 2014
BY: MLULEKI TSAWE - (University of the Western Cape, South Africa)
*/
clear all
use "BDIR72FL", clear
set more off
********************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000
/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **/
** SURVEY SET
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata)
////////////////////////////////////////////////////////////////////////////////
** FOR TABLE 3.4 EXPOSURE TO MASS MEDIA **
** READING NEWSPAPERS (at least once a week)
cap drop news_once
recode v157 (2/3=1 "Yes") (else=0 "No"), gen(news_once)
label variable news_once "Reads a newspaper at least once a week?"
label values news_once news_once
svy: tab v013 news_once, percent format(%4.1f) row
** WATCHES TV (at least once a week)
cap drop watch_tv
recode v159 (2/3=1 "Yes") (else=0 "No"), gen(watch_tv)
label variable watch_tv "Watches television at least once a week?"
label values watch_tv watch_tv
svy: tab v013 watch_tv, percent format(%4.1f) row
** LISTENS TO THE RADIO (at least once a week)
cap drop listen_radio
recode v158 (2/3=1 "Yes") (else=0 "No"), gen(listen_radio)
label variable listen_radio "Listens to the radio at least once a week?"
label values listen_radio listen_radio
svy: tab v013 listen_radio, percent format(%4.1f) row
***********************************************************
** ACCESSES ALL THREE MEDIA (at least once a week)
cap drop all_media
gen all_media = 0
foreach groupvar of varlist news_once watch_tv listen_radio {
replace all_media=1 if (news_once==1 & watch_tv==1 & listen_radio==1)
}
*
label define all_media 0"No" 1"Yes"
label variable all_media "Accesses all three media at least once a week"
label values all_media all_media
svy: tab v013 all_media, count format(%4.0f)
svy: tab v013 all_media, percent format(%4.1f) row
********************************************************************************
** NO ACCESS TO ALL THREE MEDIA
cap drop no_media
gen no_media = 0
foreach groupvar of varlist news_once watch_tv listen_radio {
replace no_media=1 if (news_once==0 & watch_tv==0 & listen_radio==0)
}
*
label define no_media 0"No" 1"Yes"
label variable no_media "Accesses none of the three media at least once a week?"
label values no_media no_media
svy: tab v013 no_media, count format(%4.0f)
svy: tab v013 no_media, percent format(%4.1f) row
exit
|
|
|
|
|