Displaying 20 results from an estimated 10000 matches similar to: "specials issue, a heads up"
2020 Feb 24
1
specials issue, a heads up
In the long run, coming up with a way to parse specials in formulas
that is both clean and robust is a good idea - annoying users are a
little bit like CRAN maintainers in this respect. I think I would
probably do this by testing identical(eval(extracted_head),
survival::Surv) - but this has lots of potential annoyances (what if
extracted_head is a symbol that can't be found in any attached
2024 Aug 26
9
specials and ::
The survival package makes significant use of the "specials" argument of terms(), before
calling model.frame; it is part of nearly every modeling function. The reason is that
strata argments simply have to be handled differently than other things on the right hand
side. Likewise for tt() and cluster(), though those are much less frequent.
I now get "bug reports" from the
2012 Oct 13
4
Problems with coxph and survfit in a stratified model with interactions
I?m trying to set up proportional hazard model that is stratified with
respect to covariate 1 and has an interaction between covariate 1 and
another variable, covariate 2. Both variables are categorical. In the
following, I try to illustrate the two problems that I?ve encountered, using
the lung dataset.
The first problem is the warning:
To me, it seems that there are too many dummies
2012 Oct 14
1
Problems with coxph and survfit in a stratified model, with interactions
First, here is your message as it appears on R-help.
On 10/14/2012 05:00 AM, r-help-request@r-project.org wrote:
> I?m trying to set up proportional hazard model that is stratified with
> respect to covariate 1 and has an interaction between covariate 1 and
> another variable, covariate 2. Both variables are categorical. In the
> following, I try to illustrate the two problems that
2020 Feb 24
0
specials issue, a heads up
On 24/02/2020 8:55 a.m., Therneau, Terry M., Ph.D. via R-devel wrote:
> I recently had a long argument wrt the survival package, namely that the following code
> didn't do what they expected, and so they reported it as a bug
>
> ? survival::coxph( survival::Surv(time, status) ~ age + sex + survival::strata(inst),
> data=lung)
>
> a. The Google R style guide? recommends
2012 Jun 05
1
model.frame and predvars
I was looking at how the model.frame method for lm works and comparing
it to my own for coxph.
The big difference is that I try to retain xlevels and predvars
information for a new model frame, and lm does not.
I use a call to model.frame in predict.coxph, which is why I went that
route, but never noted the difference till now (preparing for my course
in Nashville).
Could someone shed light
2012 Nov 17
4
survfit & number of variables != number of variable names
This works ok:
> cox = coxph(surv ~ bucket*(today + accor + both) + activity, data = data)
> fit = survfit(cox, newdata=data[1:100,])
but using strata leads to problems:
> cox.s = coxph(surv ~ bucket*(today + accor + both) + strata(activity),
> data = data)
> fit.s = survfit(cox.s, newdata=data[1:100,])
Error in model.frame.default(data = data[1:100, ], formula = ~bucket + :
2018 Mar 08
4
Fwd: Re: [EXTERNAL] Re: backquotes and term.labels
Ben,
Looking at your notes, it appears that your solution is to write your own terms() function
for lme.? It is easy to verify that the "varnames.fixed" attribute is not returned by the
ususal terms function.
Then I also need to write my own terms function for the survival and coxme pacakges?
Because of the need to treat strata() terms in a special way I manipulate the
formula/terms in
2013 Nov 14
1
issues with calling predict.coxph.penal (survival) inside a function
Thanks for the reproducable example. I can confirm that it fails on my machine using
survival 2-37.5, the next soon-to-be-released version,
The issue is with NextMethod, and my assumption that the called routine inherited
everything from the parent, including the environment chain. A simple test this AM showed
me that the assumption is false. It might have been true for Splus. Working this
2012 May 16
1
Evaluation without using the parent frame
I've been tracking down a survival problem from R-help today. A short
version of the primary issue is reconstructed by the following simple
example:
library(survival)
attach(lung)
fit <- coxph(Surv(time, status) ~ log(age))
predict(fit, newdata=data.frame(abe=45))
Note the typo in the last line of "abe" instead of "age". Instead of an
error message, this returns
2011 Feb 21
2
Anomaly in [.terms
This arose when working on an addition to coxph, which has the features
that the X matrix never has an intercept column, and we remove strata()
terms before computing an X matrix. The surprise: when a terms object
is subset the intercept attribute is turned back on.
My lines 2 and 3 below were being executed just before a call to
model.frame. The simple solution was of course to do them in the
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable
that interacted with strata (zed) was not a factor variable.
But I had stated the problem incorrectly. It's not that there are too
many strata terms; there are too many non-strata terms when the variable
interacting with the stratification factor is a factor variable. Here
is a simple example, where I have
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable
that interacted with strata (zed) was not a factor variable.
But I had stated the problem incorrectly. It's not that there are too
many strata terms; there are too many non-strata terms when the variable
interacting with the stratification factor is a factor variable. Here
is a simple example, where I have
2011 Feb 03
3
coxph fails to survfit
I have a model with quant vars only and the error message does not make sense:
(mod1 <- coxph(Surv(time=strt,time2=stp,event=(resp==1))~ +incpost+I(amt/1e5)+rate+strata(termfac),
subset=dt<"2010-08-30", data=inc,method="efron"))
Call:
coxph(formula = Surv(time = strt, time2 = stp, event = (resp ==
1)) ~ +incpost + I(amt/1e+05) + rate + strata(termfac),
2011 Dec 12
1
k-folds cross validation with conditional logistic
--begin inclusion --
I have a matched-case control dataset that I'm using conditional
logistic regression (clogit in survival) to analyze. I'm trying to
conduct k-folds cross validation on my top models but all of the
packages I can find (CVbinary in DAAG, KVX) won't work with clogit
models. Is there any easy way to do this in R?
-end inclusion --
The clogit funciton is simply a
2013 Jan 31
1
obtainl survival curves for single strata
Dear useRs,
What is the syntax to obtain survival curves for single strata on many subjects?
I have a model based on Surv(time,response) object, so there is a single row per subject and no start,stop and no switching of strata.
The newdata has many subjects and each subject has a strata and the survival based on the subject risk and the subject strata is needed.
If I do
newpred <-
2009 Feb 25
3
survival::survfit,plot.survfit
I am confused when trying the function survfit.
my question is: what does the survival curve given by plot.survfit mean?
is it the survival curve with different covariates at different points?
or just the baseline survival curve?
for example, I run the following code and get the survival curve
####
library(survival)
fit<-coxph(Surv(futime,fustat)~resid.ds+rx+ecog.ps,data=ovarian)
2011 May 06
2
coxph and survfit issue - strata
Dear users,
In a study with recurrent events:
My objective is to get estimates of survival (obtained through a Cox model) by rank of recurrence and by treatment group.
With the following code (corresponding to a model with a global effect of the treatment=rx), I get no error and manage to obtain what I want :
data<-(bladder)
2008 Apr 21
2
Trend test for survival data
Hello,
is there a R package that provides a log rank trend test
for survival data in >=3 treatment groups?
Or are there any comparable trend tests for survival data in R?
Thanks a lot
Markus
--
Dipl. Inf. Markus Kreuz
Universitaet Leipzig
Institut fuer medizinische Informatik, Statistik und Epidemiologie (IMISE)
Haertelstr. 16-18
D-04107 Leipzig
Tel. +49 341 97 16 276
Fax. +49 341 97 16
2018 Mar 08
1
Fwd: Re: [EXTERNAL] Re: backquotes and term.labels
>>>>> Ben Bolker <bbolker at gmail.com>
>>>>> on Thu, 8 Mar 2018 09:42:40 -0500 writes:
> Meant to respond to this but forgot.
> I didn't write a new terms() function -- I added an attribute to the
> terms() (a vector of the names
> of the constructed model matrix), thus preserving the information at
> the point when