Skip to content
Prev 377574 / 398502 Next

Applying a certain formula to a repeated sample data

Dear Jim,

I wish also to use the means calculated and apply a certain formula on the
same data frame. In particular, I would like to subtract the means of each
of these seven days from each of the seven days and and divide the outcome
by the same means. If I represent m1 by the means of each seven days in
column 1, and c1 is taken as column 1 data. My formula will be of the form:
aa<-(c1-m1)/m1.

I tried it on the first 7 rows and I have what I am looking for.:
 -0.0089986156
  -0.0031149054
   0.0042685741
   0.0094600831
   0.0019612367
  -0.0044993078
   0.0009229349

But doing it manually will take much time.

Many thanks for going a step further to assist me.

Warmest regards.
Ogbos
On Wed, Nov 28, 2018 at 4:31 AM Jim Lemon <drjimlemon at gmail.com> wrote: