[R] Continous variables with implausible transformation?

Frank E Harrell Jr f.harrell at Vanderbilt.Edu
Thu Jun 3 19:34:32 CEST 2010


On 06/03/2010 11:32 AM, Joris Meys wrote:
> You're right, it is the same. using I() won't work for the same reason sqrt
> don't, so :
>
>> x2<- x^2
>> lrm(y~x+x2)
>
> Thx for the correction.
> Cheers
> Joris
>
> On Thu, Jun 3, 2010 at 6:14 PM, Bert Gunter<gunter.berton at gene.com>  wrote:
>
>> Below. -- Bert
>>
>> Bert Gunter
>> Genentech Nonclinical Biostatistics
>> --------------------------------------
>> But you wrote linear+ square. Don't you mean:
>> lrm(Y~x+x^2)
>>
>> --- I believe this is the same as lrm(Y ~ x).
>> You must protect the x^2 via
>>
>> lrm(Y ~ x + I(x^2))

But don't use that construct.  Use lrm(Y ~ pol(x, 2))

Frank

>>
>> ------------------------------------------
>>
>> --
> Joris Meys
> Statistical Consultant
>
> Ghent University
> Faculty of Bioscience Engineering
> Department of Applied mathematics, biometrics and process control
>
> Coupure Links 653
> B-9000 Gent


-- 
Frank E Harrell Jr   Professor and Chairman        School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list