LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 24 Feb 2011 10:10:03 -0800
Reply-To:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject:   Re: Calculating Mean Days
In-Reply-To:   <F2FB6BD965B8AF40BA59B9AC10FCEF210503BB0360@EXCHVS7A.mx.state.mo.us>
Content-Type:   text/plain; charset=utf-8

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Pashi, Arthur > Sent: Thursday, February 24, 2011 9:47 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Calculating Mean Days > > 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

Arthur, To get your mean days of poor physical and mental health and activity limits, you don't need to create any new variables. The following should get you started.

proc surveymeans data = ast.asthma07 mean clm; strata vstrtum ; weight finl_wt; var physhlth menthlth actlimit; domain asthma; run;

I am not sure how you want to handle the mean days of poor physical or mental health. If someone has 20 days of poor physical health and 20 days of poor mental health, do you want to add those to yield 40 days of poor mental or physical health in the month, or something else?

Dan

Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204


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