Displaying 20 results from an estimated 4000 matches similar to: "model.frame problem"
2011 May 26
5
Survival: pyears and ratetable: expected events
Dear all,
I am having a (really) hard time getting pyears to work together with a
ratetable to give me the number of expected events (deaths).
I have the following data:
dos, date of surgery, as.Date
dof, date of last follow-up, as.Date
dos, date of surgery, as.Date
sex, gender, as.factor (female,male)
ev, event(death), 0= censored at time point dof, 1=death at time point dof
Could someone
2012 Nov 30
1
Baffled with as.matrix
I'm puzzled by as.matrix. It appears to work differently for Surv objects.
Here is a session from my computer:
tmt% R --vanilla
> library(survival)
Loading required package: splines
> ytest <- Surv(1:3, c(1,0,1))
> is.matrix(ytest)
>[1] TRUE
> attr(ytest, 'type')
[1] "right"
> attr(as.matrix(ytest), 'type')
[1] "right"
>
2010 Dec 31
3
survexp - example produces error
Dear All,
reposting, because I did not find a solution, maybe someone could
check the example below.
It's taken from the help page of survdiff. Executing it, gives the error
"Error in floor(temp) : Non-numeric argument to mathematical function"
best regards,
Heinz
library(survival)
## Example from help page of survdiff
## Expected survival for heart transplant patients based
2011 Apr 20
2
survexp with weights
Hello,
I probably have a syntax error in trying to generate an expected
survival curve from a weighted cox model, but I can't see it. I used
the help sample code to generate a weighted model, with the addition
of a "weights=albumin" argument (I only chose albumin because it had
no missing values, not because of any real relevance). Below are my
code with the resulting error
2012 Oct 06
2
Expected number of events, Andersen-Gill model fit via coxph in package survival
Hello,
I am interested in producing the expected number of events, in a
recurring events setting. I am using the Andersen-Gill model, as fit
by the function "coxph" in the package "survival."
I need to produce expected numbers of events for a cohort,
cumulatively, at several fixed times. My ultimate goal is: To fit an
AG model to a reference sample, then use that fitted model
2009 Jan 19
1
further notes on model.frame issue
This is a follow-up on my note of Saturday. Let me start with two important
clarifications
- I think this would be a nice addition, but I've had exactly one use for it
in the 15+ years of developing the survival package.
- I have a work around for the current case.
Prioritize accordingly.
The ideal would be to change survexp as follows:
fit <- survexp( ~ gender,
2010 Nov 11
3
Evaluation puzzle
The survexp function can fail when called from another function. The "why" of
this has me baffled, however.
Here is a simple test case, using a very stripped down version of survexp:
survexp.test <- function(formula, data,
weights, subset, na.action, rmap,
times, cohort=TRUE, conditional=FALSE,
ratetable=survexp.us, scale=1, npoints, se.fit,
2011 May 11
2
changes in coxph in "survival" from older version?
Hi all,
I found that the two different versions of "survival" packages, namely 2.36-5
vs. 2.36-8 or later, give different results for coxph function. Please see
below and the data is attached. The second one was done on Linux, but Windows
gave the same results. Could you please let me know which one I should trust?
Thanks,
...Tao
#####============================ R2.13.0,
2010 Apr 16
1
R CMD check tells me 'no visible binding for globalvariable'
Henrik wrote:
I think what people are also thinking about is that the policy for
publishing a package on CRAN is that it have to pass R CMD check with
no errors, warnings *or* notes. So, in that sense notes are no
different from warnings.
---------------------------------
Getting rid of these notes would be very hard in the survival package.
The population survival routines (survexp, pyears)
2012 Aug 09
1
basehaz() in package survival and warnings with coxph
I've never seen this, and have no idea how to reproduce it.
For resloution you are going to have to give me a working example of the
failure.
Also, per the posting guide, what is your sessionInfo()?
Terry Therneau
On 08/09/2012 04:11 AM, r-help-request at r-project.org wrote:
> I have a couple of questions with regards to fitting a coxph model to a data
> set in R:
>
> I have a
2001 Nov 12
2
check() warnings for survival-2.6
I am not sure if this is the right place for that kind of questions, but
I wondered
that the recommended package survival did not pass R's check procedure
without
warnings:
1) unbalanced braces:
* Rd files with unbalanced braces:
* man/Surv.Rd
* man/cluster.Rd
* man/cox.zph.Rd
* man/coxph.Rd
* man/coxph.detail.Rd
* man/date.ddmmmyy.Rd
* man/lines.survfit.Rd
*
2010 Dec 20
0
survexp - unable to reproduce example
Dear All,
when I try to reproduce an example of survexp, taken from the help
page of survdiff, I receive the error message
"Error in floor(temp) : Non-numeric argument to mathematical function"
.
It seems to come from match.ratetable. I think, it has to do with
character variables in a ratetable.
I would be interested to know, if it works for others. With an older
version of
2010 Oct 07
1
model.frame deficiency
The model.frame function has trouble with a certain type of really long
formula. Here is a test:
tname <- paste('var', 1:50, sep='')
tmat <- matrix(rnorm(500), ncol=50, dimnames=list(NULL, tname))
tdata <- data.frame(tmat)
temp1 <- paste( paste(tname, tname, sep='='), collapse=', ')
temp2 <- paste("~1 + cbind(", temp1, ")")
2011 May 12
3
Survival Rate Estimates
Dear List,
Is there an automated way to use the survival package to generate survival
rate estimates and their standard errors? To be clear, *not *the
survivorship estimates (which are cumulative), but the survival *rate *
estimates...
Thank you in advance for any help.
Best,
Brian
[[alternative HTML version deleted]]
2009 May 21
1
Changelog for the survival package
> Several changes in print.survfit, plot.survfit and seemingly in the structure
> of ratetabels effect some of my syntax files.
> Is there somewhere a documentation of these changes, besides the code itself?
I agree, the Changelog.09 file is not as comprehensive as one would like.
Specific comments:
1. The ratetables were recently changed to accomodate a new option. I thought
2012 Mar 27
2
PROTECT help
I received the following note this AM. The problem is, I'm not quite
sure how to fix it.
Can one use PROTECT(coxlist(eval(PROTECT.... , do I create an
intermediate variable, or otherwise?
I'm willing to update the code if someone will give me a pointer to the
right documentation. This particular chunk was written when there was a
lot of change going on in the callback mechanism and
2024 Sep 15
1
Possible update to survival
I got good feedback from the list about a scope issue, so I am coming back for more.
Prior issue: users who type survival::coxph(survival::Surv(time, status) ~ x1 + x2 + surv ival::strata(group), data=mydata)
This messes up the character string matching for strata, done via tt <- terms(formula, specials= ?strata?). The code runs, and gives the wrong answer (group is treated as an ordinary
2008 Sep 10
2
relsurv package
Dear R-users,
I have a couple of questions about the relsurv package:
1) when I try to run the example:
fit <- rsmul(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365.24,sex=sex,year=year),ratetable=slopop,data=rdata)
with the datasets in the package (rdata and slopop) it gives me an error:
Error in nrow(x) : object "x" not found
2)
If I have a date format
2000 Apr 05
1
problem with survexp in survival5
survexp in survival5 doesn't seem to work for me. see below:
> library(survival5)
Attaching Package "package:survival5":
The following object(s) are masked from package:base :
sort.list
> library(chron)
> data(ratetables)
> survexp(~ratetable(year=julian(6,1,1991),
+ sex=1,age=35*365.24),times=(0:30)/6*365.24)
Error in as.character(as.date(c(min(R[, 3]),
2007 Oct 31
3
Homework help: Is this how CIs of normal distributions are computed?
I'm looking for a function in R similar to t.test() which was generously
pointed out to me yesterday, but which can be used for normally
distributed data.
To recap yesterday:
> x <- scan()
1: 62 52 68 23 34 45 27 42 83 56 40
12:
Read 11 items
> alpha<- .05
> t.test(x)
One Sample t-test
data: x
t = 8.8696, df = 10, p-value = 4.717e-06
alternative hypothesis: true