[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: sas help!!
From: "Michael S. Zdeb" <msz03 () HEALTH ! STATE ! NY ! US>
Date: 2004-04-30 16:48:04
[Download RAW message or body]
Hi. One way to do this..
Use PROC SUMMARY and the COMPLETETYPES option instead of PROC FREQ. If one
can assume that the diseases are grouped with a format...
proc format;
value $disease
... = 'hepatitis'
... = 'salmonella'
... = 'chickenpox'
;
run;
proc summary data=olddata nway completetypes;
class disease region / preloadfmt;
format disease $disease.;
output out=newdata;
run;
proc transpose data=newdata out=even_newer_data (drop=_:) prefix=region;
var _freq_;
by disease;
id region;
run;
If DISEASE is not formatted and your data really includes the disease
names, you could still do this, using...
proc format;
value $disease
'hepatitis' = 'hepatitis'
'salmonella' = 'salmonella'
'chickenpox' = 'chickenpox'
;
run;
and list all the diseases you want in your table from month-to-month.
COMPLETETYPES and PRELOADFMT are also PROC TABULATE options, but do not
work in PROC FREQ.
Mike Zdeb
U@Albany School of Public Health
1 University Drive
Rensselaer, NY 12144-3456
(P)518-402-6479
(F)630-604-1475
> ---------+---------------------------->
> > Nevin Krishna |
> > <nevinkrishna@hot|
> > mail.com> |
> > Sent by: "SAS(r) |
> > Discussion" |
> > <SAS-L@LISTSERV.U|
> > GA.EDU> |
> > >
> > >
> > 04/30/2004 12:03 |
> > PM |
> > Please respond to|
> > Nevin Krishna |
> > >
> ---------+---------------------------->
>----------------------------------------------------------------------------------------------------------------------|
| \
| | To: SAS-L@LISTSERV.UGA.EDU \
| | cc: \
| | Subject: sas help!! \
| >----------------------------------------------------------------------------------------------------------------------|
Hello,
I am currently developing a program in sas to analyze disease counts
by region (9 regions in Louisiana) and using DDE, i wish to output
data to an excel template on a monthly basis. The variables in the
dataset are
disease (name of disease)
month (month of diagnosis)
year (year of diagnosis)
region (region)
To fill the specific cells in excel that i want, i first create a
dataset by using
proc freq work.data;
tables disease*region/ out=work.newdata;
run;
I then use transpose on newdata to get the data into a format amenable
to DDE in excel.
for example:
Disease region1 region2 region3 region4 region5 etc...
hepatitis 0 2 3 2 23
salmonella 12 13 1 134 22
chickenpox 22 2 3 33 44
etc..
since my display is based on the transposed data from the freq
procedure, i am running into a problem when there are no cases for a
disease. in otherwords my template has a row for measles, but one
month may have no reports of measles, therefore "measles" will not
show up in the freq procedure.. How do i get sas to display all of the
diseases even if there is no data for the disease..Thank you for your
help,
Nevin Krishna
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic