[R] Monotone Transformation

Martin Maechler maechler at stat.math.ethz.ch
Sat Apr 18 18:34:05 CEST 2009


>>>>> "FJ" == Feng Jingyu <FengJin at BATTELLE.ORG>
>>>>>     on Fri, 17 Apr 2009 11:22:01 -0700 (PDT) writes:

    FJ> Hi, I am trying to use R to mimic what I did in SAS.

    FJ> proc transreg data=x ;
    FJ>   model identity(GSI)=monotone(group1);
    FJ>   output out=d2 pprefix=M;
    FJ> run; 

    FJ> Accroding to SAS documentation, the MONOTONE transfomation algorithm comes
    FJ> from (Kruskal 1964, secondary approach to ties). I have tried ace. it does
    FJ> provide some kind of monotone transformation, but it is not what I expected.

    FJ> Here is how sas output look like:

    FJ> Obs      GSI        TGSI     group1    Tgroup1

    FJ> 1     0.81301    0.81301       1      1.55594
    FJ> 2     0.79359    0.79359       2      1.55594
    FJ> 3     1.26900    1.26900       3      2.59702
    FJ> 4     2.02680    2.02680       4      4.29111

    FJ> group1 is the inital value. Tgroup1 is the monotone transformed value.

    FJ> Here is how Transformed value output from ace:

    FJ> $tx
    FJ> [,1]
    FJ> [1,] -0.5698602
    FJ> [2,] -0.1899534
    FJ> [3,]  0.1899534
    FJ> [4,]  0.5698602

    FJ> Does anybody have any idea whether I could do the similar thing in R? If I
    FJ> can do it, which function I should use?

I don't know what exactly you want,
and I'd never want to read SAS code to understand your question, 
but it could be that  isoreg()  can solve your problem,
notably 
	rr <- isoreg(x,y)
	rr $yf  ## your "transformed" y

Regards,
Martin Maechler, ETH Zurich

    FJ> Thanks,
    FJ> Jingyu




More information about the R-help mailing list