s-news
[Top] [All Lists]

Re: Calculation done on rows for select columns

To: Jason.Overstreet@honeywell.com, s-news@lists.biostat.wustl.edu
Subject: Re: Calculation done on rows for select columns
From: "Francisco J. Zagmutt" <gerifalte28@hotmail.com>
Date: Mon, 23 Jan 2006 18:24:11 +0000
In-reply-to: <04A1697DA10CC54EAC443DD63568766E69F4A8@fl51exch99.space.honeywell.com>
?rowMeans


From: "Overstreet, Jason (FL51)" <Jason.Overstreet@honeywell.com>
To: s-news@lists.biostat.wustl.edu
Subject: [S] Calculation done on rows for select columns
Date: Mon, 23 Jan 2006 10:56:18 -0700

I have a data frame as shown below called xy:

> xy
  x.1 x.2 x.3 y.1 y.2 y.3
1   1   5   9   2  10  18
2   2   6  10   4  12  20
3   3   7  11   6  14  22
4   4   8  12   8  16  24
>

I was wondering what would be an easy way to have the mean and variance
calculated and stored as follows:
>    xy

        x.1     x.2     x.3     mean.x  var.x   y.1     y.2     y.3
mean.y  var.y
1       1       5       9       5               16      2       10      18
10              64
2       2       6       10      6               16      4       12      20
12              64
3       3       7       11      7               16      6       14      22
14              64
4       4       8       12      8               16      8       16      24
16              64
>



Jason Overstreet
Statistician
Honeywell DSES
(727) 539-3964





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