similar to: creating Surv object from character vector

Displaying 20 results from an estimated 6000 matches similar to: "creating Surv object from character vector"

2009 Jul 16
2
quoting expressions in a list
Dear R-help, I am having quite a difficult time coming up with what I want to do involving named lists. I have a list of logical expressions, and I would really like it if the "names" of the components of the list were identical to the corresponding logical expression. So, as an example: df.example <- data.frame(a = 1:10, b = rnorm(10, 5)) list.example <- list(df.example$a
2013 Jan 14
1
Does psm::Surv handle interval2 data?
Does Surv in psm handle interval2 data? The argument list seems to indicate it does but I get an error. Thanks, Chris # code library('survival') left <- c(1, 3, 5, NA) right <-c(2, 3, NA, 4) Surv(left, right, type='interval2') survreg(Surv(left, right, type='interval2') ~ 1) library('rms') Surv(left, right, type='interval2') # error args(Surv)
2015 Jul 24
0
Re: virsh dominfo does not show correct cpuTime
I was getting vCPU use time outside of guest with libvirt-python API, and them calculate utilization with (cpuTime2 - cpuTime1) / (t2 - t1). I was not doing this inside the guest os. 2015-07-24 15:09 GMT+08:00 2020human <human2020@qq.com>: > You calculate is vCPU use time not utilization。 > > use_time/total_cpu_time is utilization。 > > total_cpu_time=`cat /proc/stat |sed -n
2007 Nov 09
2
wrapper for coxph with a subset argument
Dear R-help - Thanks to those who replied yesterday (Christos H. and Thomas L.) regarding my question on coxph and model formula, the answers worked perfectly. My new question involves the following. I want to run several coxph models (package survival) with the same dataset, but different subsets of that dataset. I have found a way to do this, described below in functions subwrap1 and
2010 Feb 17
2
array question
Hello All: If I do have: x = (2, 4, 5, 5, 6, 4, 5, 2, 1) y = (9, 11.5, 12.5, 13, 14, 19, 20, 21, 22) I wanted to find a simple function in R which calculates the averages of X and Y for every 4 unit increase of Y. The results should look like: x = (4, 6, 3) #where (2+ 4+ 5+ 5)/ 4 = 4 and ... y = (12, 14, 20.5) #where (9+11.5+12.5+13)/ 4 = 12 and ... Thanks, Mohsen
2007 Nov 08
2
mapply, coxph, and model formula
Hello - I am wanting to create some Cox PH models with coxph (in package survival) using different datasets. The code below illustrates my current approach and problem with completing this. ### BEGIN R SAMPLE CODE ############################## library(survival) #Define a function to make test data makeTestDF <- function(n) { times <- sample(1:200, n, replace = TRUE) event
2005 Oct 11
1
summary of Surv object crashes R 2.2.0 (PR#8203)
Full_Name: Victor Moreno Version: 2.2.0 OS: windows Submission from: (NULL) (213.151.99.160) summary of an object class Surv (package survival) hangs and closes R 2.2.0 I would like to have Surv objects in a data frame to build models easier: t<-rexp(100) s<-rbinom(100,1,.3) surv<-Surv(t,s) x1<-rnorm(100,10,2) x2<-rnorm(100,10,2) dat<-data.frame(surv,x1,x2)
2004 Aug 11
2
str and Surv objects
Dear R People: I used the "Surv" function to produce the following object: >a <- Surv(1:4,2:5,c(0,1,1,0)) a [1] (1,2+] (2,3 ] (3,4 ] (4,5+] >str(a) Error in "[.Surv"(object, 1:ile) : subscript out of bounds > Why does str(a) give an error, please? Or did I do something wrong? Thanks in advance. R Version 1.9.1 Windows Sincerely, Laura Holt mailto: lauraholt_983
2007 May 02
3
the Surv function
Hi, I'm trying to do a simple survival analysis on some data, and I'm having the following problem (here's my code and the error message): out <- Surv(fup,event=status) Error in Surv(fup, event = status) : argument "time2" is missing, with no default >From reading the documentation, it seems that I should be able to simply write: Surv(time1, event) if my data is
2012 Dec 06
1
as.matrix.Surv -- R core question/opinions
1. A Surv object is a matrix with some extra attributes. The as.matrix.Surv function removes the extras but otherwise leaves it as is. 2. The last several versions of the survival library were accidentally missing the S3method('as.matrix', 'Surv') line from their NAMESPACE file. (Instead it's position is held by a duplicate of the line just above it in the NAMESPACE file,
2009 Jul 13
1
survSplit with data.frame containing a Surv object
Dear All, since years I am struggling with Surv objects in data.frames. The following seems to have to do with it. See below the modified example from the help page of survSplit. The original works, as expected. If, however, a Surv object is added to the data.frame, each record gets doubled. Is there some solution other than avoiding Surv objects in data.frames? Thanks, Heinz
2011 May 08
1
question about val.surv in R
Dear R users: I tried to use val.surv to give an internal validation of survival prediction model. I used the sample sources. # Generate failure times from an exponential distribution set.seed(123) # so can reproduce results n <- 1000 age <- 50 + 12*rnorm(n) sex <- factor(sample(c('Male','Female'), n, rep=TRUE, prob=c(.6, .4))) cens <- 15*runif(n) h
2011 Aug 20
1
val.surv
 Dear R-users,   I  have two questions regarding validation and calibration of Survival regression models.   1.  I am trying to calibrate and validate a cox model using val.surv. here is my code:  f.1<-cph(Surv(time,event)~age, x=T, y=T, data=train)  test1<-test[,"age"]  val.surv(f.1, newdata=data.frame(test1), u=10)    but I get an error message:    Error in val.surv(f.1, newdata
2006 Mar 16
2
Surv object in data.frame and Design package
Dear All, there seems to be some strange influence of the Design package on data.frame. If I build a data.frame containing a Surv object without loading the package Design, the data frame is usable to coxph. If instead I just load Design and build a data.frame afterwards, the naming of the Surv object is different and it does not work with coxph. (In my real application I loaded Design to use the
2006 Mar 15
5
Surv object in data.frame
Dear All, a Surv object I put in a data frame behaves somehow unexpected (see example). If I do a Cox regression on the original Surv object it works. If I put it in a data.frame and do the regression on the data frame it does not work. Seemingly it has to do with the class attribute, because if I change the class attribute to let "Surv" appeare first, again it works. Is this known?
2006 Feb 13
2
Survreg(), Surv() and interval-censored data
Can survreg() handle interval-censored data like the documentation says? I ask because the command: survreg(Surv(start, stop, event) ~ 1, data = heart) fails with the error message Invalid survival type yet the documentation for Surv() states: "Presently, the only methods allowing interval censored data are the parametric models computed by 'survreg'"
2001 May 23
1
Passing a string variable to Surv
Hi, I am trying to write a function to automate multiple graph generation. My data looks like: Table of numeric values with the following headers: timeM1 statusM1 xM1 timeM2 statusM2 xM2 timeM3 statusM3 xM3 1 2 3 4 5 6 Where M1,M2, M3 hve no similarity except they have a max string length of 7. Examples are mcw0045, adl0003, lei0101. Now, what I want to do is Function(M1, M2,
2009 May 22
2
System crash when using surv=T in cph
Can someone help me. I am very new to R. I am fitting a Cox model using Frank Harrell's cph as I want to produce a Nomogram. This is what I have done: Srv<- Surv(time,cens) f.cox<- cph(Srv~ v1+v2+v3+v4, x=T, y=T, surv=T) As soon as I press enter, Windows XP crashes. If I remove surv=T, then it works. I have R version 2.9.0. Is there a way of displaying the parameter estimates (ie beta
2009 May 15
1
Function Surv and interpretation
Dear everyone, My question involves the use of the survival object. We can have Surv(time,time2,event, type=, origin = 0) (1) As detailed on p.65 of: http://cran.r-project.org/web/packages/survival/survival.pdf My data (used in my study) is 'right censored' i.e. my variable corresponding to 'event' indicates whether a person is alive (0) or dead (1) at date last seen
2011 Jul 15
1
validate survival with val.surv
Dear R users: I want to externally validate a model with val.surv. Can I use only calculated survival (at 1 year) and actual survival? Or I needed the survival function and actual survival. Thanks *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* [[alternative HTML version deleted]]