ehlers at ucalgary.ca
Thu Jul 19 21:30:58 CEST 2012
On 2012-07-19 07:10, Bart Ferket wrote:
> Dear professor Harrell,
> I probably have the same problem as Haleh Ghaem Maralani.
> I am using the rms package and the rcspline.plot function to assess the
> relation of a continuous predictor to the log hazard function.
> I would like to use the "adj" statement, for example using this test
> test <-read.csv("file.csv",header=TRUE)
> rcspline.plot(test$factor, test$Time,model="cox", adj=cbind(test$adj1,
> Then I get the following Error.
> -0.7860188 3.4871734 -4.6087226 -0.6761077 -0.9358280
>  -3686.955 -3646.681
> Error in pchisq(q, df, lower.tail, log.p) :
> Non-numeric argument to mathematical function
> Could you please help us understanding how to use the adj statement?
> Bart Ferket, MD, dept. Epidemiology, ErasmusMC Rotterdam
[You're replying to a year-old post; it would probably have
been better to start a new thread.]
I think that there may be a bug in rcspline.plot that
may be easily fixed. Grab the code of rcspline.plot()
and edit it as follows:
1. Find the line with
adj.df <- attr(v, "rank")
and replace it with
adj.df <- qr(v)[["rank"]]
2. Save the function as "myrcspline.plot".
3. Fix the evironment of your new function:
environment(myrcspline.plot) <- environment(rcspline.plot)
Now use myrcspline.plot in your analysis. Works for me, but
I'm no expert in such models and don't what side effects
this change might have.
More information about the R-help