Hello, I am a total newbie in SAS and I'm writing my thesis using the NHANES data. I couldn't quite figure out how to code the physical activity classification and I would really appreciate it if anyone could help me. One of my covariate factors is total physical activity and I have referred to the GPAQ (Global Physical Activity Questionnaire) guide from WHO. I matched it with the variables from NHANES codebook and I'm trying to classify it by level of total physical activity. The translated variables are the following: P2 (# of days vigorous work) = paq610 P3 (# of mins vigorous work/day) = pad615 P5 (# of days moderate work) = paq625 P6 (# of mins moderate work/day) = pad630 P8 (# of days walk or bicycle) = paq640 P9 (# of mins walk/bicycle for transportation) = pad645 P11 (# of days vigorous recreational activities) = paq655 P12 (# of mins vigorous recreational activities) = pad660 P14 (# of days moderate recreational activities) = paq675 P15 (# of mins moderate work/day) = pad675 P16 (# of mins sedentary activity) = pad680 I came up with the following code: /*Physical Activity*/
data demo_dep9;
set demo_dep8;
/*compute total physical activity or total MET-min/week*/
totPA=(paq610*pad615*8)+(paq625*pad630*4)+(paq640*pad645*4)+(paq655*pad660*8)+(paq670*pad675*4);
if (paq610+paq655)>=3 and totPA>=150 or
(paq610+paq625+paq640+paq655+paq670)>=7 or totPA>=300
then PAlevel=1; /*High PA Level*/
if (paq610+paq655)>=3 and ((paq610*pad615)+(paq655*pad660))>=60 or
(paq625+paq640+paq670)>=5 and ((paq625*pad630)+(paq640*pad645)+(paq670*pad675))>=150 or
(paq610+paq625+paq640+paq655+paq670)>=5 and totPA>=60
then PAlevel=2; /*moderate PA level*/
else PAlevel=3; /*low PA level*/
run; I got the following result and it seems that most of the calculations didn't go through. I got these log results. I am quite confused as to what happened. I'd really appreciate any help or advice. Thank you!
... View more