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

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed Sep 23 13:07:37 CEST 2009


You might need to change the type quantile. The default is type = 7,
whereas default for SAS is type = 3 and for SPSS type = 6. Have a look
at the helpfile of quantile() for more details on the type. 

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Namens premmad
Verzonden: woensdag 23 september 2009 10:56
Aan: r-help at 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 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
-tp25530654p25531047.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




More information about the R-help mailing list