How to Create New Variables to Describe Physical Activity Guideline Adherence – Minutes of Weekly Physical Activity

In the preceding How-to segments, you learned how to create variables to describe weekly minutes of activity for the Household/Yard, Transportation, and Leisure-Time physical activity domains. In our analysis, we will combine minutes of activity from these three domains for comparison to physical activity guideline recommendations.

The Physical Activity Guidelines for Americans state:

“For substantial health benefits, adults should do at least 150 minutes (2 hours and 30 minutes) a week of moderate-intensity, or 75 minutes (1 hour and 15 minutes) a week of vigorous-intensity aerobic physical activity, or an equivalent combination of moderate- and vigorous intensity aerobic activity.”

In plain speech, vigorous activity requires twice the effort of moderate activity. By “doubling” minutes of vigorous activity we create a representative summary of total vigorous activity that can directly be added to total minutes of moderate activity. 

The table below includes snippets of code from the program.

Sample Code


label PAG_MINW = 'Physical Activity Guidelines  - Minutes per Week' ;

Now that PAG_MINW is expressed in minutes of moderate activity, we can compare study participants values for PAG_MINW to the weekly benchmark of 150 minutes of moderate activity. The guidelines also indicate that additional health benefits are gained for exceeding this recommendation:

“For additional and more extensive health benefits, adults should increase their aerobic physical activity to 300 minutes (5 hours) a week of moderate intensity, or 150 minutes a week of vigorous intensity aerobic physical activity, or an equivalent combination of moderate- and vigorous-intensity activity. Additional health benefits are gained by engaging in physical activity beyond this amount.”

Let’s create a categorical variable to describe study participants who (1) do not meet guideline recommendations, (2) meet guideline recommendations and obtain health benefits, (3) exceed guideline recommendations and obtain additional health benefits:

Sample Code

if PAG_MINW < 150 then ADHERENCE = 'Below' ;
if PAG_MINW >= 150 and PAG_MINW < 300 then ADHERENCE = 'Meets' ;
if PAG_MINW >= 300 then ADHERENCE = 'Exceeds' ;