Skip to content
Back to formatted view

Raw Message

Message-ID: <16805.39969.709630.570500@gargle.gargle.HOWL>
Date: 2004-11-25T08:47:29Z
From: Martin Maechler
Subject: what does order() stand for in an lme formula?
In-Reply-To: <x2u0rf3xj2.fsf@biostat.ku.dk>

>>>>> "PD" == Peter Dalgaard <p.dalgaard at biostat.ku.dk>
>>>>>     on 24 Nov 2004 19:35:45 +0100 writes:

    PD> "Harry Athanassiou" <hathanassiou at automatedcell.com>
    PD> writes:
    >> I'm a beginner in R, and trying to fit linear models with
    >> different intercepts per group, of the type y ~ A*x1 + B,
    >> where x1 is a numerical variable. I cannot understand
    >> whether I should use y1 ~ x1 +1 or y1 ~ order(x1) + 1

    >> Although in the toy example included it makes a small
    >> difference, in models with many groups the models without
    >> order() converge slower if at all!

    PD> Er?

    PD> What gave you the idea of using order in the first
    PD> place? To the best of my knowledge, order(x) is also in
    PD> this context just a function, which for the nth
    PD> observation returns the position of the nth largest
    PD> observation in x. This is not likely to make sense as a
    PD> predictor in a model.

where on the other hand,  
      rank(x1)
may make sense and what Harry really intended to use.

Martin Maechler, ETH Zurich