|
On 5/1/08, Theorbo <reply@to-group.nfo> wrote:
> Hi. I have a dataset like this:
> ID, MONTH, DAY, MeasureA, MeasureB, MeasureC
> 1,2,13,243,221,254
> 2,2,13,244,255,263
> 1,2,13,255,278,233
> 1,2,14,223,211,266
> 2,2,15,223,277,265
>
> with multiple observations per ID, month and day. I have about 25 of these
> measures - all numeric.
>
> I am trying to get to this output dataset (to dump into Excel - don't get me
> started!):
>
> ID, Avg_A_Month1, Avg_B_Month1, Avg_C_Month1, Avg_A_Month2, Avg_B_Month2
>
> where I have one observation per ID with averages for the measures
> aggregated by month.
>
> I know it's not good to keep my "data" in the variable names - isn't that
> right?
> What's the best way for me to get from start to output?
> I started by trying to do a proc means nway noprint, class month, out= ...
> and then transposing the output dataset but then I'm left with one variable
> that contains all the variable names. Do I need to transpose twice?
>
> Any ideas? Thanks for any tips or suggestions - no code necessary.
The MEANS procedure wrapped inside the HTML output of ODS, which can
be directly opened in Excel and saved as a .xls file?
|