```Date: Thu, 24 Feb 2011 11:46:40 -0600 Reply-To: "Pashi, Arthur" Sender: "SAS(r) Discussion" From: "Pashi, Arthur" Subject: Calculating Mean Days Content-Type: text/plain; charset="us-ascii" Dear SAS-L users, My survey data set looks like this: Obs asthma physhlth menthlth actlimit 1 2-No 0 0 2-No 2 1-Yes 30 6 1-Yes 3 2-No 15 0 1-Yes 4 2-No 0 10 2-No 5 2-No 2 20 1-Yes 6 2-No 5 1 2-No 7 2-No . 0 2-No 8 2-No 14 0 2-No Note: asthma = has asthma (1-Yes), and no asthma (2-No) physhlth = number of days with unhealthy physical health in past 30 days menthlth = number of days with unhealthy mental health in past 30 days actlimit = frequency (days) of activity limitation I want to calculate the following: 1. Given asthma equal 1-yes, compute a. Mean physically unhealthy days b. Mean mentally unhealthy days c. Mean physically or mentally unhealthy days d. Mean days of activity limitation 2. Given asthma equal 2-No, compute e. Mean physically unhealthy days f. Mean mentally unhealthy days g. Mean physically or mentally unhealthy days h. Mean days of activity limitation I have used proc means as follows: Data = ; Set ; if 1 le physhlth le 30 then phdnoasth = 1; else if physhlth = 0 then phdnoasth = 0; label phdnoasth= 'Mean physically unhealthy days in past 30'; run; proc surveymeans data = ast.asthma07 mean clm; strata vstrtum ; weight finl_wt; var phdnoasth mentdnoasth phmtdnoasth actlimnoasth; domain asthma; run; Instead of mean numbers of days, my results are rather percentages. Any help is welcome. Thank you Arthur K. Pashi ```

Back to: Top of message | Previous page | Main SAS-L page