From: <jhainm_at_fas.harvard.edu>

Date: Wed 27 Jul 2005 - 05:48:31 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 27 05:55:32 2005

Date: Wed 27 Jul 2005 - 05:48:31 EST

Hi,

store<-c(1,1.4,3,1.1,0.3,0.6,4,5)

*# now I want to get the precentages of values
*

# that fall into the categories <=M , >M & <=N , >N

*# let
*

M <-.8

N <- 1.2

# In my real example I have many more of these cutoff-points

# What I did is:

out <- matrix(NA,1,3)

out[1,1] <- ( (sum(store<=M )) /length(store) )*100 out[1,2] <- ( (sum(store> M & store<= N )) /length(store) )*100 out[1,3] <- ( (sum(store> N )) /length(store) )*100

colnames(out)<-c("percent<=M","percent>M & <=N","percent>N") out

But this gets very tedious if I have many cutoff-points. Does anybody know a more elegant way to do this task?

Thanks so much.

Cheers,

Jens

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 27 05:55:32 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:34:01 EST
*