similar to: Extracting values from Surv function in survival package

Displaying 20 results from an estimated 1000 matches similar to: "Extracting values from Surv function in survival package"

2024 May 16
1
Extracting values from Surv function in survival package
Hi Dennis, look at the help page for summary.survfit, the Value n.event. G?ran On 2024-05-15 22:41, Dennis Fisher wrote: > OS X > R 4.3.3 > > Colleagues > > I have created objects using the Surv function in the survival package: >> FIT.1 > Call: survfit(formula = FORMULA1) > > n events median 0.95LCL 0.95UCL >
2007 Aug 01
1
Problem to remove loops in a routine
Dear R-users, I have written the following code to generate some trellis plots. It works perfectly fine except that it is quite slow when it is apply to my typical datasets (over several thousands of lines). I believe the problem comes from the loops I am using to subset my data.frame. I read in the archives that the tapply function is often more efficient than a loop in R. Unfortunately ,
2009 Sep 14
3
Eliminate cases in a subset of a dataframe
Hi folks, I created a subset of a dataframe (i.e., selected only men): subdata <- subset(data,data$gender==1) After a residual diagnostic of a regression analysis, I detected three outliers: linmod <- lm(y ~ x, data=subdata) plot(linmod) Say, the cases 11,22, and 33 were outliers. Here comes the problem: When I want to exclude these three cases in a further regression analysis, - for
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all, First, let's create some data to play around: set.seed(1) (df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) ## Now we need the empirical distribution function: edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x ##
2003 Mar 25
2
Help with data.frame subsets
Hello all, I'm trying to get a subset of a data frame by taking all rows where the 2nd column is >= Min and <= Max. I can do that by a 2 step process similar to the following: subData <- dataFrame[dataFrame[,2] >= Min,] subData2 <- subData[subData[,2] <= Max,] Then I try to graph the results where col 2 is the X var and col 3 is the Y var. Therefore I do the following: X
2011 Oct 31
1
googleVis motionchart - slow with Date class
Hi, I am trying to create a googleVis motion chart with monthly data. When formatting the date column as a Date class variable, the plot as presented in the browser becomes considerably slower and very prone to crashing the browser. To illustrate this issue I have modified the WorldBank demo. ### objects from demo("WorldBank", package = "googleVis") M <-
2007 Oct 01
3
mean of subset of rows
Dear list, this must be an easy one: I have a data.frame of two columns, "ID" with four different levels (A to D) and numerical "size", and each of the 4 different IDs is repeated a different number of times. I would like to get the mean size for each ID as another data.frame. I have tried the following: >ID= as.character(unique(data[,1])) # I use unique() because
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
2017 Oct 19
2
Select part of character row name in a data frame
Dear R contributors, I have a problem in selecting in an efficient way, rows of a data frame according to a condition, which is a part of a row name of the table. The data frame is made of 64 rows and 2 columns, but the row names are very long but I need to select them according to a small part of it and perform calculations on the subsets. This is the example: X Y "Unique to
2015 Jun 16
1
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry Therneau has been very helpful on r-help but we can't figure out what change in R in the past months made extra columns appear in model.matrix when the terms object is subsetted to remove stratification factors in a Cox model. Terry has changed his logic in the survival package to avoid this issue but he requires generating a larger design matrix then dropping columns. A simple
2017 Oct 19
0
Select part of character row name in a data frame
(Re-)read the discussion of indexing (both `[` and `[[`) and be sure to get clear on the difference between matrices and data frames in the Introduction to R document that comes with R. There are many ways to create numeric vectors, character vectors, and logical vectors that can then be used as indexes, including the straightforward way: df[ c( "Unique to strat ", "Unique
2008 Jun 19
2
Advanced Filtering problem
http://www.nabble.com/file/p18018170/subdata.csv subdata.csv I've attached 100 rows of a data frame I am working with. I have one factor, id, with 27 levels. There are two columns of reference data, x and y (UTM coordinates), one column "date" in POSIXct format, and one column "diff" in times format (chron package). What I am trying to do is as follows: For each day
2010 Apr 29
2
Rotating Titles
Hi All, I am looking for help in rotating species titles produced using the strat.plot( ) function in the rioja package. This function produces a stratigraphic plot of paleoenvironmental data. Currently the titles of each species are plotted vertically while they are typically plotted at a 45 degree angle in other programs. Does anyone have any idea of how to rotates these titles? Below is an
2011 Mar 10
2
using lapply
I have a function with the follow signare: apply.strategy(instr, strat) where instr and strat are both objects of classes instrument and strategy respectively. I want to apply this function to a list that holds objects of the class instrument. Currently I am doing this by explicit looping: for(i in length(instr.list) ) { apply.strategy(instr.list[[i]], my.strat) } Is it possible to
2007 Jun 21
2
Overlaying lattice graphs (continued)
Dear R Users, I recently posted an email on this list about the use of data.frame and overlaying multiple plots. Deepayan kindly indicated to me the panel.superposition command which worked perfectly in the context of the example I gave. I'd like to go a little bit further on this topic using a more complex dataset structure (actually the one I want to work on). >mydata Plot
2009 Oct 01
5
How to use Subpopulation data?
Dear Helpers   I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.   H <- matrix(rnorm(100, mean=50000, sd=5000)) sampleframe=data.frame(type=c(rep("H",100)),value=c(H)) sampleframe   str=strata(sampleframe,c("type"),size=c(20,), method="srswor")
2017 Oct 19
2
Select part of character row name in a data frame
Thanks a lot, so simple so efficient! I will study more the grep command I did not know. Thanks! Francesca Pancotto > Il giorno 19 ott 2017, alle ore 12:12, Enrico Schumann <es at enricoschumann.net> ha scritto: > > df[grep("strat", row.names(df)), ] [[alternative HTML version deleted]]
2017 Oct 19
0
Select part of character row name in a data frame
Quoting Francesca PANCOTTO <f.pancotto at unimore.it>: > Dear R contributors, > > I have a problem in selecting in an efficient way, rows of a data > frame according to a condition, > which is a part of a row name of the table. > > The data frame is made of 64 rows and 2 columns, but the row names > are very long but I need to select them according to a small
2012 Apr 10
6
trust relationship between this workstation and the primary domain failed
Samba shares work for windows 7 and Server 2008, but XP and Server 2000 recieve the following error when trying to map samba shares: "The trust relationship between this workstation and the primary domain failed." tail -f /var/log/messages Apr 10 07:38:03 samba01 smbd[23581]:?? connect_to_domain_password_server: unable to open the domain client session to machine ad1.strat.com. Error