Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7578673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:29:20+00:00 2026-05-30T17:29:20+00:00

I am trying to obtain survival estimates for different people at a specific time.

  • 0

I am trying to obtain survival estimates for different people at a specific time.

My code is as follows:

s = Surv(outcome.[,1], outcome.[,2])        
survplot= (survfit(s ~ person.list[,1]))  
plot(survplot, mark.time=FALSE)            

summary(survplot[1], times=4)[1]           

This code creates the survival object, creates a survival curve for each 11 of the people, plots each of the curves, and with the summary function I can obtain the survival estimate for person 1 at time = 4.

I am trying to create a list of the survival estimates for each person at a specified time (time = 4).

Any help would be appreciated.

Thanks,
Matt

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:29:20+00:00Added an answer on May 30, 2026 at 5:29 pm

    If all that you say is true, then this is a typical way of generating a list using indices as arguments:

     t4list <- lapply(1:11, function(x) summary(survplot[x], times=4)[1] )
     t4list
    

    If you really meant that you wanted a vector of survival estimates based at that time, then sapply would make an attempt to simply the result to an atomic form such as a numeric vector or a matrix in the case where the results were “multidimensional”. I would have thought that you could have gotten a useful result with just:

    summary(survplot, times=4)[1]
    

    That should have succeeded in giving you a vector of predicted survival times (assuming such times exist.) If you get too greedy and push out the ‘times’ value past where there are estimates, then you will throw an error. Ironically that error will not be thrown if there is at least one time where all levels of the covariates have an estimate. Using the example in the help page as a starting point:

    fit <- survfit(Surv(time, status) ~ x, data = aml) 
    summary(fit, times=c(10, 20, 60) )[1]
    #$surv
    #[1] 0.9090909 0.7159091 0.1840909 0.6666667 0.5833333
    # not very informative about which times and covariates were estimated 
    # and which are missing
    
    # this is more informative
    as.data.frame( summary(fit, times=c(10, 20, 60) )[c("surv", "time", "strata")])
           surv time          strata
    1 0.9090909   10    x=Maintained
    2 0.7159091   20    x=Maintained
    3 0.1840909   60    x=Maintained
    4 0.6666667   10 x=Nonmaintained
    5 0.5833333   20 x=Nonmaintained
    

    Whereas if you just use 60 you get an error message:

    > summary(fit, times=c( 60) )[1]
    Error in factor(rep(1:nstrat, scount), labels = names(fit$strata)) : 
      invalid labels; length 2 should be 1 or 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to log into a site and obtain the code back, but i'm
I'm trying to find a MySQL query which will obtain the time that is
I am trying to obtain a variable from a different file type and import
I'm trying to obtain a specific li element from a unordered list. I'm doing
I am trying to obtain the ctl property that is specific to each row
I am trying to obtain JSON object in the following code. The problem is,
I am trying to obtain embeded code through extracting variables from Youtube video URLs.
I am trying to obtain an element width using the following code just before
I am trying to obtain a simple conversion from one time zone into another
I'm trying to obtain the machine precision on gmp variables. To that end, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.