Displaying 20 results from an estimated 1000 matches similar to: "how to check linearity in Cox regression"
2008 May 09
2
how to check linearity in Cox regression
Hi, I am just wondering if there is a test available for testing if a linear fit of an independent variable in a Cox regression is enough? Thanks for any suggestions.
John Zhang
____________________________________________________________________________________
[[elided Yahoo spam]]
2017 Nov 01
3
Cox Regression : Spline Coefficient Interpretation?
Hi,
I'm using a Cox-Regression to estimate hazard rates on prepayments.
I'm using the "pspline" function to face non-linearity, but I have no clue
how to interpret the result.
Unfortunately I did not find enough information on the "pspline" function
wether in the survival package nor using google..
I got following output:
* library(survival)*
>
>
>
>
2011 Sep 20
0
Using method = "aic" with pspline & survreg (survival library)
Hi everybody. I'm trying to fit a weibull survival model with a spline
basis for the predictor, using the survival library. I've noticed that it
doesn't seem to be possible to use the aic method to choose the degrees of
freedom for the spline basis in a parametric regression (although it's
fine with the cox model, or if the degrees of freedom are specified directly
by the user),
2012 Oct 19
1
Addition of plot=F argument to termplot
I have a suggested addition to termplot.
We have a local mod that is used whenever none of the termplot options is quite right. It
is used here almost daily for Cox models in order to put the y axis on a risk scale:
----
fit <- coxph(Surv(time, status) ~ ph.ecog + pspline(age), data=lung)
zz <- termplot(fit, se=TRUE, plot=FALSE)
yy <- zz$age$y + outer(zz$age$se, c(0, -2, 2),
2011 Apr 06
1
help on pspline in coxph
Hi there,
I have a question on how to extract the linear term in the penalized
spline in coxph. Here is a sample code:
n=100
set.seed(1)
x=runif(100)
f1 = cos(2*pi*x)
hazard = exp(f1)
T = 0
for (i in 1:100) {
T[i] = rexp(1,hazard[i])
}
C = runif(n)*4
cen = T<=C
y = T*(cen) + C*(1-cen)
data.tr=cbind(y,cen,x)
fit=coxph(Surv(data.tr[,1],
2018 Jan 15
1
Time-dependent coefficients in a Cox model with categorical variants
Suppose I have a dataset contain three variants, looks like
> head(dta)
Sex tumorsize Histology time status
0 1.5 2 12.1000 0
1 1.8 1 38.4000 0
.....................
Sex: 1 for male; 0 for female., two levels
Histology: 1 for SqCC; 2 for High risk AC; 3 for low risk AC,
2017 Nov 02
0
Cox Regression : Spline Coefficient Interpretation?
Always reply to the list. I do not do private consulting.
(I have cc'ed this to the list).
I still think this belongs on stackexchange, not r-help. I think you need
to read up on the mathematics of spline bases.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his
2010 Feb 16
1
survival - ratio likelihood for ridge coxph()
It seems to me that R returns the unpenalized log-likelihood for the ratio likelihood test when ridge regression Cox proportional model is implemented. Is this as expected?
In the example below, if I am not mistaken, fit$loglik[2] is unpenalized log-likelihood for the final estimates of coefficients. I would expect to get the penalized log-likelihood. I would like to check if this is as expected.
2003 Apr 01
2
predict in Pspline package (PR#2714)
To whom it may concern,
I don't know whether this is really a bug with the Pspline package or
only a problem with my installation. Things work fine in Linux but
not in Mac OS X (Darwin). Both system run the latest public versions
of R and Pspline.
predict.smooth.Pspline produces only NaN instead of predicted values
when norder>2:
> library (Pspline)
> tt <- seq
2013 Feb 28
2
predict.smooth.Pspline function not found
I have a simple question that irritatingly I haven't been able to figure
out on my own. It seems that some functions from the "Pspline" package are
successfully installed while others are not. The code with which I'm
working is more complicated, but the following highlights my problem. If I
run the following code
> tt <- seq (0,1,length=20)
> xt <- tt^3
> fit
2003 Jan 22
1
something wrong when using pspline in clogit?
Dear R users:
I am not entirely convinced that clogit gives me the correct result when I
use pspline() and maybe you could help correct me here.
When I add a constant to my covariate I expect only the intercept to change,
but not the coefficients. This is true (in clogit) when I assume a linear in
the logit model, but the same does not happen when I use pspline().
If I did something similar
2002 Nov 25
2
Pspline smoothing
Dear all,
I'm trying to use the Pspline add-on package to fit a quintic spline
(norder =3), but I keep running into a Singularity error.
> traj.spl <- smooth.Pspline(time, x, norder=3 )
Error in smooth.Pspline(time, x, norder = 3) :
Singularity error in solving equations
>
Playing around with the other parameters produces an "unused arguments" error:
> traj.spl
2010 Nov 29
1
Evaluation of survival analysis
Dear all,
May I ask is there any functions in R to evaluate the fitness of "coxph" and
"survreg" in survival analysis, please?
For example, the results from Cox regression and Parametric survival
analysis are shown below. Which method is prefered and how to see that / how
to compare the methods?
1. coxph(formula = y ~ pspline(x1, df = 2))
2008 Apr 23
2
help on coxph.wtest
Hi,
i need to use pspline. In this pspline function coxph.wtest was used. When I
try to make some change to this function by pulling out the pspline
function, it turns out R gave me an error msg, saying coxph.wtest cannot be
found. Even if i dont change anything in pspline and just rename it and run
the function, it did not work out. Can any one help me with this? is there
anyway to get the
2010 Nov 24
2
Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?
Hi all,
Is there an equivalent to predict(...,type="linear") of a Proportional hazard
model for a Cox model instead?
For example, the Figure 13.12 in MASS (p384) is produced by:
(aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ +
pspline(age, df=6), data = Aidsp))
zz <- predict(aids.ps, data.frame(state = factor(rep("NSW", 83), levels =
2009 Aug 01
2
Cox ridge regression
Hello,
I have questions regarding penalized Cox regression using survival
package (functions coxph() and ridge()). I am using R 2.8.0 on Ubuntu
Linux and survival package version 2.35-4.
Question 1. Consider the following example from help(ridge):
> fit1 <- coxph(Surv(futime, fustat) ~ rx + ridge(age, ecog.ps, theta=1), ovarian)
As I understand, this builds a model in which `rx' is
2011 Jul 15
1
Plotting survival curves from a Cox model with time dependent covariates
Dear all,
Let's assume I have a clinical trial with two treatments and a time to
event outcome. I am trying to fit a Cox model with a time dependent
treatment effect and then plot the predicted survival curve for one
treatment (or both).
library(survival)
test <-
list(time=runif(100,0,10),event=sample(0:1,100,replace=T),trmt=sample(0:1,100,replace=T))
model1 <- coxph(Surv(time,
2011 May 29
1
Fitting spline using Pspline
Hey all,
I seem to be having trouble fitting a spline to a large set of data using
PSpline. It seems to work fine for a data set of size n=4476, but not for
anything larger (say, n=4477). For example:
THIS WORKS:
-----------------------------
random = array(0,c(4476,2))
random[,1] = runif(4476,0,1)
random[,2] = runif(4476,0,1)
random = random[order(random[,1]),]
plot(random[,1],random[,2])
2008 May 09
1
predicting from coxph with pspline
Hello.
I get a bit confused by the output from the predict function when used
on an object from coxph in combination with p-spline, e.g.
fit <- coxph(Surv(time1, time2, status)~pspline(x), Data)
predict(fit, newdata=data.frame(x=1:2))
It seems like the output is somewhat independent of the x-values to
predict at. For example x=1:2 gives the same result as x=21:22. Does the
result span the
2010 Nov 17
1
where are my pspline knots?
Hi All,
I am trying to figure out how to get the position of the knots in a pspline used in a cox model.
my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous
How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot.
Best,
Federico
--
Federico C. F. Calboli
Department of Epidemiology