Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
Ya it works thanks for the help -- View this message in context: http://www.nabble.com/use-of-class-variable-in-r-as-in-Proc-means-of-sas-tp25530654p25531102.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread Girish A.R.
See if this works: qfun2 <- function(x, digits=3,sci=F,...){ c(q=quantile(x, probs=c(1,5,10,95,99)/100,type=6,...) ) } cheers, -Girish === premmad wrote: > > I tried thanks for your help and got the same result for percentile 5 & 95 > as in SAS.But if i need to calcu

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread ONKELINX, Thierry
@r-project.org Onderwerp: Re: [R] use of class variable in r as in Proc means of sas Thanks for the help.I got the required quantiles by altering ur code as follows qfu<-function(x,digits=3,sci=F,...) {c(q=quantile(x,probs=c(5,90)/100)) } and my result of the R system is different from my

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
I tried thanks for your help and got the same result for percentile 5 & 95 as in SAS.But if i need to calculate quantiles (1,5,10,99,etc.) it will not be possible with fivenum as explained in the help page .If i need those quantiles what is the change i need to make in the function qfu<-function(

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
Thanks for the help.I got the required quantiles by altering ur code as follows qfu<-function(x,digits=3,sci=F,...) {c(q=quantile(x,probs=c(5,90)/100)) } and my result of the R system is different from my sas system output for the same function .could anyone help me in this and what is the rea

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread Girish A.R.
Replace your qfu as follows: qfu <- function(x, digits=3,sci=F,...){ c(q=fivenum(x, ...) ) } Look up fivenum function for more information. cheers, -Girish = premmad wrote: > > Thanks for the help.I got the required quantiles by altering ur code > as follows > > q

Re: [R] use of class variable in r as in Proc means of sas

2009-09-22 Thread Girish A.R.
Here's the code that does the job for quartiles (0,25,50,75,100). To get to your objective of (5,10,25,75,90) is left as an exercise. There are several well-written introductory books in R, in addition to the freely available presentations and other online resources. I think you should spend some

Re: [R] use of class variable in r as in Proc means of sas

2009-09-22 Thread jim holtman
Is this what you want: > x zip price 1 6567000 2 60001478654 3 60004485647 4 60001 2783958 5 60005 97845848 6 60006 378383478 7 60002 397895735 8 60001 487587575 9 60002478848 10 60003 49847874 11 60004467648 12 60005567489 13 60006 4776746 14 60

[R] use of class variable in r as in Proc means of sas

2009-09-22 Thread premmad
Hi,everyone i need to calculate quartile values of a variable grouped by the other variable . same as in aggregate function(only median,mean or functions is possible-i think so) Could you please help me to achieve the same for other quartile values(5,10,25,75,90) as for median using aggregate. Th