Re: [R] Decile

From: Phil Spector <spector_at_stat.berkeley.edu>
Date: Wed, 16 Jun 2010 16:22:21 -0700 (PDT)

Arturo -

     Something like

cut(x,quantile(x,(0:10)/10),labels=FALSE,include.lowest=TRUE)

should give you what you want.

On Wed, 16 Jun 2010, J. Arturo Coral Alamo wrote:

> Hello comunity,
>
> I'm trying to find a similar function as decile of SPSS, NTILES (10)
> some of you know about that, I will appreciate your help in advance.
>
> In SPSS
> VARIABLES=Sales (A) /NTILES (10) /PRINT=NO
>
> for example if I have Next data input:
>
> case IdCust Sales Profit 1 265 140.81 314.31 2 266 1778.96 408.32 3 267
> 2663.66 820.85 4 268 2994.14 913.73 5 269 2185.58 686.64 6 271 105.21 18.94
>
>
> Output must be:
>
> case IdCust Sales Profit Ntil-Sales Ntil-Profi 1 265 140.81 314.31 2 2 2 266
> 1778.96 408.32 4 4 3 267 2663.66 820.85 8 8 4 268 2994.14 913.73 10 10 5 269
> 2185.58 686.64 6 6 6 271 105.21 18.94 1 1
>
>
>
>
> Best regards,
> -----------------------------------------------
> Arturo Coral Alamo
> Business Researcher Team
> SOLUCION ESTRATEGICA Inc.
> Genera competitividad en tu empresa
> M?vil: (+511) 988 567 000
> Fijo: (+511) 528 50 44
> www.seincperu.com
>
> [[alternative HTML version deleted]]
>
>



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. Received on Wed 16 Jun 2010 - 23:24:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jun 2010 - 01:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive