| Date: | Tue, 11 Aug 2009 11:07:32 -0700 |
| Reply-To: | Richard DeVenezia <rdevenezia@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Richard DeVenezia <rdevenezia@GMAIL.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: how can you solve this senaro |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
On Aug 10, 10:25 am, hyma...@GMAIL.COM (Shaik Hymad) wrote:
> HI ALL,
> PATID SCODE PERIOD CYCE TRT SH
> 5001 A11 1 1 1 47.447
> 5001 B50 1 1 1 48.417
>
> 5001 A50 2 1 5 67.519
> 5001 A61 2 1 5 64.062
>
> 5001 D40 3 1 2 21.049
> 5001 D41 3 1 2 20.947
>
> I need output like
>
> PATID SCODE PERIOD CYCE TRT SH msh
> 5001 A11 1 1 1 47.447 47.93
> 5001 B50 1 1 1 48.417 .
>
> 5001 A50 2 1 5 67.519 65.7907
> 5001 A61 2 1 5 64.062 .
>
> 5001 D40 3 1 2 21.049 20.994
> 5001 D41 3 1 2 20.947 .
>
> how can we find mean and solve this situvation
> and i need above output like above one
You can SQL to compute the mean over the appropriate group, and use
REPORT to present the information.
-------------------
data study;
input
PATID SCODE $ PERIOD CYCE TRT SH
;
datalines;
5001 A11 1 1 1 47.447
5001 B50 1 1 1 48.417
5001 A50 2 1 5 67.519
5001 A61 2 1 5 64.062
5001 D40 3 1 2 21.049
5001 D41 3 1 2 20.947
run;
ods pdf
file="%sysfunc(pathname(WORK))\report.pdf"
style=journal;
;
proc sql;
create table study2 as
select patid, scode, period, cyce, trt, sh,
mean(sh) as mean_sh
from
study
group by
patid, period, cyce, trt
;
quit;
proc report nowindows data=study2;
columns _all_ ;
define patid / display;
define scode / display;
define period / group ;
define cyce / group;
define trt / group;
define mean_sh / group;
compute after period;
line "";
endcomp;
run;
ods pdf close;
-------------------
Richard A. DeVenezia
http://www.devenezia.com
|