survival | Survival package for R

 by   therneau R Version: Current License: No License

kandi X-RAY | survival Summary

kandi X-RAY | survival Summary

survival is a R library. survival has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

This is the source code for the "survival" package in R. It gets posted to the comprehensive R archive (CRAN) at intervals, each such posting preceded a throrough test. (I run the test suite for all 800+ packages that depend on survival.) In general, each new push to CRAN will update the second term of the version number, e.g. 2.40-5 to 2.41-0. Updates only to the github source increment after the dash. (If an error is found in the process of CRAN submission then the published CRAN version may be x.yy-1 or even x.yy-2 or 3.) This directory is a shadow of the 'real' respository, which is in mercurial on my own machine. As such I don't use git for pull requests. I will often copy code from a suggestion, however; they don't get ignored!. The vignette2 directory contains material that is not posted to CRAN. The file "tutorial.Rnw", for instance, requires data from the mstate package. Survival is a recommended package, and such packages can only depend on other recommended packages. (This allows for a consistent distribution bundle.) The sas.Rnw vignette has a discussion of compute time and takes too long to run, etc. A large portion of the source is found in the noweb directory, and is based on the literate programming ideas of Knuth. The reason is that it allows more complete documentation of the methods. I can have things like blocks of equations, and find having the "real" equations side by side with the code makes it much easier to get it right. Anyone who wants to study the methods is advised to perform "make code.pdf" in the noweb directory and then look at the relevant portion of that pdf file. Any file in the R or src directories that starts with an "automatically generated ..." comment should NOT be modified directly, instead work with the noweb source. (You will need to have the noweb package loaded in order to run the Makefile.). You should be able to install this using the following R code: library(devtools); install_github("therneau/survival"). Note that good practice would be to make derived files such as R/tmerge.R "on the fly" using a configure script; that way there would not be a danger of someone trying to modify the derived file rather than the actual source (noweb/tmerge.Rnw). However, I was not able to create a configure file that worked reliably on all platforms, and voted for usability rather than purity.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              survival has a low active ecosystem.
              It has 288 star(s) with 86 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 10 open issues and 188 have been closed. On average issues are closed in 94 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of survival is current.

            kandi-Quality Quality

              survival has no bugs reported.

            kandi-Security Security

              survival has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              survival does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              survival releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of survival
            Get all kandi verified functions for this library.

            survival Key Features

            No Key Features are available at this moment for survival.

            survival Examples and Code Snippets

            Return the survival function .
            pythondot img1Lines of Code : 9dot img1License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def _survival_function(self, y):
                if self._is_maybe_event_override:
                  raise NotImplementedError("survival_function is not implemented when "
                                            "overriding event_shape")
                if not self.bijector._is_injective:  # p  
            Log survival function .
            pythondot img2Lines of Code : 9dot img2License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def _log_survival_function(self, y):
                if self._is_maybe_event_override:
                  raise NotImplementedError("log_survival_function is not implemented when "
                                            "overriding event_shape")
                if not self.bijector._is_injecti  

            Community Discussions

            QUESTION

            plot function in R producing legend without legend() being called
            Asked 2021-Jun-12 at 19:46

            I'm trying to produce a cumulative incidence plot for a competing hazards survival analysis using plot() in R. For some reason, the plot that is produced has a legend that I have not called. The legend is intersecting with the lines on my graph and I can't figure out how to get rid of it. Please help!

            My code is as follows:

            ...

            ANSWER

            Answered 2021-Jun-09 at 13:28

            You are using the cuminc function from the cmprsk package. This produces an object of class cuminc, which has an S3 plot method. ?plot.cuminc shows you the documentation and typing plot.cuminc shows you the code.

            There is some slightly obscure code that suggests a workaround:

            Source https://stackoverflow.com/questions/67904833

            QUESTION

            How can one add a ">" symbol while producing survival curves in R?
            Asked 2021-Jun-08 at 16:56

            Is there a way to add the greater than symbol ">" in ggsurvplot? in the figure legend?

            Here is my sample dataset and code for this problem:

            ...

            ANSWER

            Answered 2021-Jun-08 at 16:51

            It's worth reviewing what's actually happening. The ggtext function attempts to parse the labels using tags and the blockquote tag (>) is not supported. So we need some way to escape the tag. I couldn't find a documented way.

            It's a bit of a hack, but I've added a zero width space unicode character (\u200B) before the > to break the tag:

            Source https://stackoverflow.com/questions/67890410

            QUESTION

            Similar function to R's logsum function (mlogit package) for Survival package
            Asked 2021-Jun-07 at 00:20

            I was trying to obtain the expected utility for each individual using R's survival package (clogit function) and I was not able to find a simple solution such as mlogit's logsum.

            Below I set an example of how one would do it using the mlogit package. It is pretty straight forward: it just requires regressing the variables with the mlogit function, save the output and use it as an argument in the logsum function -- if needed, there is a short explanation in this vignette. And what I want is to know the similar method for clogit. I've read the package's manual but I have failed to grasp what would be the most adequate function to perform the analsysis.

            Note1: My preference for a function like mlogit's is related to the fact that I might need to perform tons of regressions later on and being able to perform the correct estimation in different scenarios would be helpful.

            Note2: I do not intend that the dataset created below be representative of how data should behave. I've set the example solely for the purpose of perfoming the function after the logit regressions.

            **

            ...

            ANSWER

            Answered 2021-Jun-07 at 00:20

            The vignette you offer says the logsum is calculated as:

            To my reading that is similar to the calculation used to construct the "linear predictor". the lp is t(coef(clog)) %*% Xhat. If I'm correct on that interpretation, then that is stored in the clog-object:

            Source https://stackoverflow.com/questions/67757336

            QUESTION

            How do I represent domain knowledge information with bnlearn
            Asked 2021-Jun-05 at 14:47

            I am learning about Dynamic Bayesian Network models using the R package bnlearn. To this end, I am following this paper where they impose certain constraints in the form of 6 layers (Table 1 in the paper):

            ...

            ANSWER

            Answered 2021-Jun-05 at 14:47

            You can add domain knowledge or constraints to structure learning in a couple of ways.

            • If you want to specify the network structure and parameters using domain knowledge, you can build the network manually using custom.fit.

            • If you want to estimate the structure of the BN from data then you can impose constraints on edge direction & edge presence using the whitelist and blacklist parameters in the structure learning algorithms.

            • A prior can be placed on the edges in structure learning (e.g. prior="cs", where "If prior is cs, beta is a data frame with columns from, to and prob specifying the prior probability for a set of arcs. A uniform probability distribution is assumed for the remaining arcs."). There are other priors that can be used.

            Source https://stackoverflow.com/questions/67785734

            QUESTION

            PyTorch NN does not learn or learns poorly
            Asked 2021-Jun-04 at 17:03

            I'm working with PyTorch tutorial, slightly modified to use Titanic dataset. I'm using very simple network of Linear(Dense) with ReLU... I'd like to predict survival status based on age, fare and sex for example.

            I experienced a strange behavior with a simple neural network (I'm experimenting on Google Colab). Sometimes when I execute training, the accuracy doesn't change at all. It's strange because I'm recreating the model...

            ...

            ANSWER

            Answered 2021-Jun-04 at 17:03

            As this is a classification problem, your neural network's last layer should not have a relu activation function.

            Code Snippet:

            Source https://stackoverflow.com/questions/67840919

            QUESTION

            Trying to convert the tick value of Y-Axis Scale in SAS
            Asked 2021-Jun-03 at 04:04

            I'm trying to convert the tick value of Y-Axis Scale from (0 .2 .4 .6 .8 1.0) to (0 .01 .02 .03 .04 .05), but failed. However, no such problem when converting viewmax

            ...

            ANSWER

            Answered 2021-Jun-01 at 15:27

            QUESTION

            How to run multiple .sh files from different directories
            Asked 2021-Jun-02 at 19:53

            SO I have a BSD server and want to host a Minecraft BungeeCoord server. The thing is the server files are in different directories EG: /home/name/bungee/servers/Survival/start.sh AND /home/name/bungee/servers/Lobby/start.sh

            Is there a way to make a file that can run multiple files from different directories ?

            Just to make it clear, the reason I want to do this is because the BSD server can only take 1 file at a time, like shell/terminal.

            Edit: The command I ended up using was screen

            ...

            ANSWER

            Answered 2021-Apr-05 at 09:30

            somewhat sorted by least to most advanced

            example 1

            Source https://stackoverflow.com/questions/66165098

            QUESTION

            Check if component is active to hide it
            Asked 2021-May-31 at 20:00

            I created a array of objects and I render them based on a click event. Is there any way using Vue that If I click for example the 'survival' button, if it's already set as the activeCategory, it hides itself? Like an accordion behavior.

            ...

            ANSWER

            Answered 2021-May-31 at 20:00

            Sure, in your method you can check if the activeCategory is already the same category and in that case set it back to the default of '':

            Source https://stackoverflow.com/questions/67779541

            QUESTION

            R, how to use a variable to select different columns of a dataframe in ggplot2?
            Asked 2021-May-27 at 03:13

            I have a dataframe containing results measured through Matthews correlation coefficient, F1 score, and accuracy, and I would like to generate barcharts for each of these metrics in R using ggplot2. I am trying to loop over these three rates, but R does not let me use a variable (this_rate) to select the proper dataframe column for my plot.

            Here's my (not working) code;

            ...

            ANSWER

            Answered 2021-May-27 at 03:13

            When you are passing character values of column names use .data to subset them. This works and creates separate pdf for list_of_rates.

            Source https://stackoverflow.com/questions/67715110

            QUESTION

            Kaplan meier survival curve is flipped in R?
            Asked 2021-May-26 at 06:10

            I am fitting a K.M survival model on a data and the summary for model seems fine but whenever I plot it's reversed as it 0 at day 0 and 1 at day 2500 which should be the other way around?

            ...

            ANSWER

            Answered 2021-May-26 at 06:10

            Probably your status variable death is a factor. It shouldn't be. It should be numeric.

            Run a toy example below. Here, status is a factor, so plot will look like yours:

            Source https://stackoverflow.com/questions/67698591

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install survival

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/therneau/survival.git

          • CLI

            gh repo clone therneau/survival

          • sshUrl

            git@github.com:therneau/survival.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link