s-news
[Top] [All Lists]

Data Manipulation

To: s-news@lists.biostat.wustl.edu
Subject: Data Manipulation
From: "Overstreet, Jason (FL51)" <Jason.Overstreet@honeywell.com>
Date: Tue, 10 Jan 2006 08:35:44 -0700

One day, I will be answering questions on this list instead of asking.  In the mean time, I have another data manipulation question.

Below is an example of data having a variable of interest (V1) with duplicate entries for V2 and V3.  I would like to have the mean value of the V1 values assigned to a single line for the V2 and V3. 



Current state of data:

V1      V2       V3

30           1

32      NA      1

31      NA      1

28           1      

          2

     b       NA

          2

          2

          2

1          3

1          3

11           NA

13           3

12           3

45           4

44           4

52      e       NA

Desired result:

V1      V2      V3

30.25   a       1

2.40    b       2

11.60   c       3

44.50   d       4

52      e       NA


Basically I have repeated measurements of varying sample size for a variable of interest (V1) which I want to take the mean. I want to assign it to a single row with a combination of the other variables.  Oh, one more important thing - I have well over a hundred variables that are of type date, factor, integer and double.  I just wanted a simple example for the posting.  Many thanks in advance for any help. 

 

Jason Overstreet

Statistician

Honeywell DSES

(727) 539-3964

<Prev in Thread] Current Thread [Next in Thread>