[R] use of class variable in r as in Proc means of sas
Girish A.R.
garamach at gmail.com
Wed Sep 23 11:34:41 CEST 2009
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
>
> 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 reason
> for difference in results .I have attached both outputs
> R output:
> zip price.q.5% price.q.90%
> 1 60000 567000.0 567000
> 2 60001 709184.4 390626852
> 3 60002 20349692.4 358154046
> 4 60003 49847874.0 49847874
> 5 60004 469447.9 3972289
> 6 60005 5431407.0 88118012
> 7 60006 23457082.6 341022805
>
> SAS output:
> zip Obs 5th Ptcl 90th Pctl
>
> 60000 1 567000.00 567000.00
>
> 60001 3 478654.00 487587575
>
> 60002 2 478848.00 397895735
>
> 60003 1 49847874.00 49847874.00
>
> 60004 3 467648.00 4843949.00
>
> 60005 2 567489.00 97845848.00
>
> 60006 2 4776746.00 378383478
> I have already checked that SAS and SPSS produces the same output.Do i'm
> missing anything when using the function quantile
>
--
View this message in context: http://www.nabble.com/use-of-class-variable-in-r-as-in-Proc-means-of-sas-tp25530654p25531060.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list