Date: Mon, 16 Jan 2006 08:19:22 -0500
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Art@DrKendall.org>
Organization: Social Research Consultants
Subject: Re: Percentiles
In-Reply-To: <E08B564BAA29FE4F8EC8BAF42FE0A01F67DC95@bubsex02.cen.csin.cz>
Content-type: text/plain; charset=ISO-8859-1; format=flowed
another way
RANK variables = age /percent into age_pct.
recode age_pct (lo thru 20 = 1) (20 thru hi = 2) into Y.
Art
Spousta Jan wrote:
>Hi Luca and all,
>
>I think that Greg's solution is very nice and simple, but has severe
>limitations: It is valid only if the variable x is Gaussian and the
>number of cases is huge - then the asymptotics works.
>
>But in general case one must apply exact algorithms, i.e. compute the
>true values of percentiles first. Here is an example:
>
>* save the percentile in a file.
>GET FILE='C:\Program Files\SPSS13\GSS93 subset.sav'.
>oms /SELECT TABLES /IF LABELS = ["Statistics"]
> /DESTINATION FORMAT=sav OUTFILE = 'C:\Program
>Files\SPSS13\auxfile.sav'.
>FREQUENCIES age /FORM=NOTABLE /PERC= 20.
>omsend.
>get file='C:\Program Files\SPSS13\auxfile.sav'.
>select if Var1 = "Percentiles".
>save outfile='C:\Program Files\SPSS13\auxfile.sav'.
>
>* open the original file again and merge the percentile.
>GET FILE='C:\Program Files\SPSS13\GSS93 subset.sav'.
>string Var1 (a11).
>compute Var1 = "Percentiles".
>MATCH FILES /FILE=*
> /TABLE='C:\Program Files\SPSS13\auxfile.sav'
> /BY Var1 /drop Command_ Subtype_ Label_ Var2 Var3.
>EXECUTE.
>
>* compute the transformed variable y.
>compute y = age <= Var4.
>exe.
>var lab y "Age is <= 20th percentile of Age (1-0)".
>form y (f2).
>del var Var1 Var4.
>
>Greetings
>
>Jan
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
>Meyer, Gregory J
>Sent: Saturday, January 14, 2006 6:51 PM
>To: SPSSX-L@LISTSERV.UGA.EDU
>Subject: Re: Percentiles
>
>Luca, assuming you are interested in using a sample determined
>percentile, here's one way to do what you want.
>
>* Convert observed scores to standardized Z scores
> using the M and SD from your sample .
>
>DESCRIPTIVES
> VARIABLES= X (X_zscore) /SAVE .
>
>* Because a Z score of -.84 cuts off the lowest 20% of the
> distribution, recode based on the X_zscore variable.
>
>RECODE
> r_zscore
> (Lowest thru -.84 = 1) (ELSE = 0) INTO Y .
>EXECUTE .
>
>* Note, the cut off value can be modified to any percentile you desire
> using the normal curve equivalents found in the back of any stats book
>.
>
>Greg
>
>| -----Original Message-----
>| From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf
>| Of Luca Meyer
>| Sent: Saturday, January 14, 2006 2:59 AM
>| To: SPSSX-L@LISTSERV.UGA.EDU
>| Subject: Percentiles
>|
>| Is there any easy way to compute a X percentile of a variable? What i
>| need is something like:
>|
>| IF X<=PERCENTILE(20) Y=1.
>|
>| That is: if the value of X for each single case is lower or equal to
>| the 20% percentile of X then Y=1.
>|
>| Is this somehow possible?
>|
>| Thanks,
>| Luca
>|
>| Mr. Luca MEYER
>| Survey research, data analysis & more: http://www.lucameyer.com/
>| Tel: +390122854456 - Fax: +391782232575 - Mobile: + 393394950021
>|
>
>
>
>
|