0

我正在尝试Shiny通过构建一个非常简单的应用程序来学习基础知识。

问题:如何应用actionButton()在单击时才传递input-values 的?output$plot <- renderPlot()

app的很简单。它只包含四个组件。loading每次更改输入时,我都想避免常量。例如,每次我加载时app,它都会立即启动loading

在此处输入图像描述

我希望流程是:

(1)input选择了四个值,屏幕没有加载绘图-->

(2) 击中actionButton()将发送选择的input-values到output$surv_plot <- renderPlot()-->

(3) 加载和plotOutput()

在此处输入图像描述

我试过添加observeEvent(input$do, {output$surv_plot <- renderPlot({ggsurvplot()})})但没有运气。

我的剧本

library(shiny)
library(shinyjs)
library(survminer)
library(shinycustomloader)
library(shinyWidgets)
library(survival)

ui <- fluidPage(
  useShinyjs(),

  titlePanel("Survival Curve\n"),

  br(),

  fluidRow(

    column(
      3,
      wellPanel(
        style = "height:150px", 
        sliderInput("n_fjernet", "Lymph Nodal Yield\n", 
                    min = 2, max = 120, value = 40)
      )
    ),

    column(
      3,
      wellPanel(
        style = "height:150px", 
        sliderInput("n_sygdom", "Number of positive lymph nodes", 
                    min = 0, max = 40, value = 0)
      )
    ),

    column(
      3,
      wellPanel(
        style = "height:150px", 
        radioButtons("ecs", "Extracapsular extension", c("No","Yes"))
      )
    ),

    column(
      3,
      wellPanel(
        style = "height:150px", 
        radioButtons("contra_pos", "Neck involvement\n", c("Contra.","Ipsi."))
      )
    )

  ),

  fluidRow(align="center", br(), actionBttn("do", "Submit", style = "material-flat")),

  fluidRow(

    column(12, align="center", 
           withLoader(plotOutput("surv_plot", width = "85%", height="800px"), 
                      type="html", loader="dnaspin")
    )

  )

)


server <- function(input, output, session) {

  observeEvent(input[["n_sygdom"]], {
    if(input[["n_sygdom"]] < 1){
      disable("ecs")
      disable("contra_pos")
    }else{
      enable("ecs")
      enable("contra_pos")
    }
  })



  observe(
    updateSliderInput(
      session = session,
      inputId = "n_sygdom",
      max = min(40, input$n_fjernet),
      value = min(input$n_fjernet, input$n_sygdom)
    )
  )




  calc_score <- reactive({
    as.numeric(round(nom$ecs$points[nom$ecs$ecs==input$ecs] +
                       nom$contra_pos$points[nom$contra_pos$contra_pos==input$contra_pos] +
                       nom$n_fjernet$points[nom$n_fjernet$n_fjernet==input$n_fjernet] +
                       nom$n_sygdom$points[nom$n_sygdom$n_sygdom==input$n_sygdom], digits=0))
  })

  calc_score_group <- function(score) {
    cut(score, c(0,30,50,70,90,Inf), include.lowest = TRUE, labels = c("1","2","3","4","5"))
  }

  fit_data <- reactive({
    p %>% filter(score.group == as.numeric(calc_score_group(calc_score())))
  })

  fit_model <- reactive({
    survfit(Surv(os.neck, mors) ~ 1, data = fit_data())
  })



  output$out.score <- renderText(calc_score())
  output$out.score.group <- renderText(calc_score_group(calc_score()))


  output$surv_plot <- renderPlot({

    n <- ggsurvplot(
      fit_model(),                     
      data = fit_data(), 
      risk.table = TRUE, 
      pval = F,      
      pval.coord = c(0, 0.25),
      conf.int = T,         
      size=1,                    
      xlim = c(0,60),
      conf.int.alpha=c(0.2),
      break.x.by = 6,    
      xlab="Time in months",
      ylab="Probability of overall survival",
      ggtheme = theme,             
      surv.median.line = "v",
      ylim=c(0,1),
      palette="#2C77BF",
      tables.theme=theme,
      legend.title=paste("Score group", calc_score_group(calc_score())),
      surv.scale="percent",
      tables.col="strata",
      risk.table.col = "strata",
      risk.table.y.text = FALSE,
      tables.y.text = FALSE)

    n$table <- n$table + labs(x = NULL, y = NULL)

    n



  })

}

shinyApp(ui, server)

我的数据p

p <- structure(list(contra_pos = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 
1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L), .Label = c("Ipsi.", "Contra."), class = "factor"), ecs = structure(c(1L, 
1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 
1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 
1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 
1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 
2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 
1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 2L, 2L, 1L, 1L), .Label = c("No", "Yes"), class = "factor"), 
    n_fjernet = c(22L, 61L, 50L, 47L, 30L, 60L, 82L, 60L, 33L, 
    67L, 35L, 56L, 15L, 37L, 44L, 124L, 41L, 30L, 31L, 35L, 36L, 
    28L, 39L, 54L, 25L, 27L, 69L, 53L, 24L, 33L, 52L, 77L, 51L, 
    7L, 22L, 53L, 26L, 58L, 28L, 83L, 39L, 15L, 37L, 27L, 9L, 
    17L, 32L, 26L, 44L, 52L, 22L, 62L, 53L, 68L, 52L, 38L, 50L, 
    21L, 41L, 74L, 15L, 26L, 36L, 37L, 34L, 22L, 31L, 53L, 13L, 
    44L, 43L, 51L, 20L, 21L, 63L, 40L, 25L, 17L, 43L, 47L, 35L, 
    21L, 4L, 23L, 35L, 50L, 69L, 24L, 38L, 45L, 37L, 35L, 25L, 
    19L, 43L, 19L, 33L, 38L, 50L, 21L, 40L, 100L, 45L, 53L, 41L, 
    7L, 75L, 48L, 20L, 11L, 72L, 37L, 34L, 70L, 20L, 47L, 44L, 
    45L, 48L, 23L, 27L, 24L, 39L, 9L, 34L, 22L, 89L, 40L, 35L, 
    34L, 61L, 28L, 27L, 62L, 47L, 13L, 20L, 9L, 27L, 38L, 44L, 
    15L, 33L, 65L, 31L, 49L, 53L, 15L, 26L, 17L, 24L, 20L, 25L, 
    12L, 34L, 22L, 27L, 14L, 27L, 31L, 26L, 15L, 16L, 30L, 19L, 
    51L, 12L, 33L, 68L, 26L, 20L, 34L, 31L, 7L, 76L, 7L, 24L, 
    36L, 22L, 27L, 35L, 64L, 18L, 38L, 10L, 27L, 26L, 47L, 15L, 
    30L, 30L, 21L, 31L, 14L, 14L, 22L, 28L, 13L, 17L, 16L), n_sygdom = c(1L, 
    2L, 1L, 3L, 1L, 0L, 3L, 0L, 2L, 1L, 4L, 4L, 1L, 0L, 2L, 2L, 
    1L, 0L, 0L, 4L, 0L, 0L, 1L, 1L, 0L, 1L, 4L, 3L, 1L, 0L, 8L, 
    1L, 1L, 1L, 1L, 1L, 0L, 1L, 2L, 1L, 0L, 2L, 1L, 0L, 2L, 0L, 
    3L, 0L, 1L, 1L, 1L, 2L, 0L, 3L, 2L, 1L, 0L, 0L, 0L, 2L, 0L, 
    3L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 4L, 0L, 0L, 2L, 2L, 1L, 
    1L, 0L, 0L, 3L, 1L, 6L, 0L, 0L, 0L, 3L, 2L, 2L, 4L, 0L, 3L, 
    27L, 0L, 2L, 1L, 0L, 0L, 1L, 1L, 2L, 2L, 5L, 1L, 0L, 0L, 
    1L, 0L, 5L, 0L, 0L, 2L, 10L, 0L, 6L, 2L, 1L, 2L, 0L, 0L, 
    0L, 0L, 4L, 0L, 0L, 1L, 5L, 2L, 2L, 1L, 2L, 1L, 0L, 0L, 1L, 
    13L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 23L, 0L, 2L, 2L, 0L, 
    2L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 2L, 3L, 1L, 4L, 0L, 1L, 0L, 
    5L, 5L, 4L, 0L, 0L, 4L, 0L, 1L, 1L, 0L, 2L, 5L, 1L, 3L, 6L, 
    1L, 1L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 
    1L, 2L, 0L, 1L, 1L, 0L, 0L), os.neck = c(9.63, 7.03, 9.17, 
    10.48, 7.69, 15.18, 13.5, 16.33, 15.31, 12.09, 12.35, 22.28, 
    15.77, 14.39, 10.02, 14.52, 8.44, 23.82, 5.95, 3.78, 19.32, 
    20.14, 15.51, 19.78, 12.98, 32.92, 9.76, 5.65, 30.75, 2.79, 
    33.58, 27.53, 27.63, 14.62, 29.17, 25.4, 18.43, 5.29, 30.75, 
    28.48, 14.69, 13.14, 6.6, 26.81, 40.74, 11.63, 13.31, 10.41, 
    9.56, 17.51, 35.78, 35.75, 37.62, 33.25, 36.96, 34.56, 40.05, 
    41.26, 24.34, 37.49, 40.94, 24.11, 39.33, 11.24, 39.1, 19.75, 
    38.93, 39.36, 36.34, 48, 29.17, 47.93, 3.68, 24.21, 46.36, 
    49.12, 50.96, 14.16, 54.01, 19.88, 50.86, 1.87, 54.24, 13.93, 
    11.6, 10.05, 23.1, 62.78, 12.58, 39, 59.83, 6.77, 60.39, 
    18.46, 61.77, 58.41, 49.45, 64.26, 2.4, 26.51, 58.94, 69.91, 
    64.66, 55.56, 46.55, 29.63, 55.66, 19.68, 7.62, 2.73, 17.77, 
    10.12, 9.95, 74.22, 57.3, 58.94, 27.01, 34.23, 78.82, 27.2, 
    83.02, 76.68, 58.15, 22.18, 14.49, 3.91, 25.92, 74.64, 66.83, 
    70.74, 38.08, 7.69, 74.55, 49.94, 11.1, 88.54, 6.44, 79.54, 
    80.82, 70.83, 12.91, 81.25, 17.38, 29.96, 94.72, 73.53, 72.54, 
    1.35, 89.69, 62.85, 7.62, 93.27, 5.09, 51.25, 62, 55.33, 
    44.62, 56.94, 94.55, 88.61, 32.46, 11.04, 16.53, 100.04, 
    24.74, 24.54, 5.75, 59.83, 59.83, 77.77, 92.78, 49.58, 91.2, 
    1.18, 18.92, 6.34, 32.46, 72.41, 105.82, 1.84, 12.78, 57.56, 
    59.14, 104.08, 15.54, 117.75, 4.27, 67.61, 19.78, 112.49, 
    53.59, 107.01, 47.57, 9.46, 53.59, 46.46, 57.33, 18.76, 82.04, 
    13.67), mors = c(0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 
    0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 
    1L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 
    1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 
    1L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 1L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 
    0L, 1L, 1L, 0L, 1L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 
    1L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 
    1L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 
    0L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 
    1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 
    0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 0L), score = c(43.5, 
    43.9, 35.6, 68.6, 41.2, 22.1, 58.7, 22.1, 51.8, 30.8, 78.7, 
    72.7, 57, 28.6, 48.7, NA, 38.1, 30.5, 30.2, 62, 28.8, 31.1, 
    38.7, 34.5, 31.9, 42.1, 57.6, 55.4, 42.9, 29.7, 80.4, 22.8, 
    35.3, 59.2, 43.5, 34.8, 31.7, 33.3, 53.2, 26.3, 28, 56.9, 
    39.3, 31.4, 58.5, 34.2, 61.3, 31.7, 37.3, 35, 43.5, 55.1, 
    24, 51.1, 46.4, 39, 24.9, 33.1, 27.4, 40.2, 34.8, 74.5, 28.8, 
    28.6, 29.4, 43.5, 41, 24, 35.3, 37.3, 64.9, 24.6, 33.4, 55.2, 
    54.8, 38.4, 42.7, 34.2, 26.9, 57.1, 51.3, 73.8, 37.9, 32.5, 
    29.1, 67.7, 53.1, 54.3, 72.7, 26.3, 59.9, 120.2, 31.9, 55.7, 
    37.6, 33.6, 29.7, 33.8, 35.6, 55.2, 49.8, 48.4, 31.9, 24, 
    27.4, 47.7, 17.8, 79.7, 33.4, 35.9, 47.1, 87.8, 29.4, 60, 
    66.9, 47.9, 48.7, 26.3, 25.5, 32.5, 31.4, 81.8, 28, 36.5, 
    51.6, 87, 47.5, 49.8, 39.8, 51.5, 44, 31.1, 31.4, 32.2, 94.8, 
    35.3, 55.6, 36.5, 53.6, 28.3, 48.8, 45.5, 29.7, 88.8, 30.2, 
    47.3, 46.1, 34.8, 53.8, 34.2, 32.2, 44.1, 54.2, 35.6, 29.4, 
    32.8, 53.5, 66.4, 53.6, 68.3, 31.7, 57, 34.5, 68.1, 87.9, 
    57.5, 35.6, 29.7, 52.7, 31.7, 44.1, 40.1, 30.2, 59.1, 71.8, 
    47.7, 75, 74.7, 43.5, 42.1, 51.3, 20.9, 33.9, 39, 58.4, 31.4, 
    31.7, 47.9, 34.8, 30.5, 30.5, 38.6, 30.2, 45.8, 57.1, 32.8, 
    53.3, 57.5, 34.2, 34.5), score.group = structure(c(2L, 2L, 
    2L, 3L, 2L, 1L, 3L, 1L, 3L, 2L, 4L, 4L, 3L, 1L, 2L, NA, 2L, 
    2L, 2L, 3L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 2L, 1L, 4L, 1L, 
    2L, 3L, 2L, 2L, 2L, 2L, 3L, 1L, 1L, 3L, 2L, 2L, 3L, 2L, 3L, 
    2L, 2L, 2L, 2L, 3L, 1L, 3L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 4L, 
    1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 3L, 1L, 2L, 3L, 3L, 2L, 2L, 
    2L, 1L, 3L, 3L, 4L, 2L, 2L, 1L, 3L, 3L, 3L, 4L, 1L, 3L, 5L, 
    2L, 3L, 2L, 2L, 1L, 2L, 2L, 3L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 
    4L, 2L, 2L, 2L, 4L, 1L, 3L, 3L, 2L, 2L, 1L, 1L, 2L, 2L, 4L, 
    1L, 2L, 3L, 4L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 5L, 2L, 3L, 
    2L, 3L, 1L, 2L, 2L, 1L, 4L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 
    3L, 2L, 1L, 2L, 3L, 3L, 3L, 3L, 2L, 3L, 2L, 3L, 4L, 3L, 2L, 
    1L, 3L, 2L, 2L, 2L, 2L, 3L, 4L, 2L, 4L, 4L, 2L, 2L, 3L, 1L, 
    2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 
    3L, 2L, 2L), .Label = c("1", "2", "3", "4", "5"), class = "factor")), row.names = c(NA, 
200L), class = "data.frame")

而我的nomogram存储在nom

nom <- structure(list(structure(list(n_fjernet = c(2, 3, 4, 5, 6, 7, 
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 
88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 
103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 
116, 117, 118, 119, 120), Xbeta = c(`1` = -0.0152562141665504, 
`2` = -0.0228843212498257, `3` = -0.0305124283331009, `4` = -0.0381405354163761, 
`5` = -0.0457686424996513, `6` = -0.0533967495829265, `7` = -0.0610248566662018, 
`8` = -0.068652963749477, `9` = -0.0762810708327522, `10` = -0.0839091779160274, 
`11` = -0.0915372849993026, `12` = -0.0991653920825779, `13` = -0.106793499165853, 
`14` = -0.114421606249128, `15` = -0.122049713332404, `16` = -0.129677820415679, 
`17` = -0.137305927498954, `18` = -0.144934034582229, `19` = -0.152562141665504, 
`20` = -0.16019024874878, `21` = -0.167818355832055, `22` = -0.17544646291533, 
`23` = -0.183074569998605, `24` = -0.19070267708188, `25` = -0.198330784165156, 
`26` = -0.205958891248431, `27` = -0.213586998331706, `28` = -0.221215105414981, 
`29` = -0.228843212498257, `30` = -0.236471319581532, `31` = -0.244099426664807, 
`32` = -0.251727533748082, `33` = -0.259355640831357, `34` = -0.266983747914633, 
`35` = -0.274611854997908, `36` = -0.282239962081183, `37` = -0.289868069164458, 
`38` = -0.297496176247734, `39` = -0.305124283331009, `40` = -0.312752390414284, 
`41` = -0.320380497497559, `42` = -0.328008604580834, `43` = -0.33563671166411, 
`44` = -0.343264818747385, `45` = -0.35089292583066, `46` = -0.358521032913935, 
`47` = -0.366149139997211, `48` = -0.373777247080486, `49` = -0.381405354163761, 
`50` = -0.389033461247036, `51` = -0.396661568330311, `52` = -0.404289675413587, 
`53` = -0.411917782496862, `54` = -0.419545889580137, `55` = -0.427173996663412, 
`56` = -0.434802103746687, `57` = -0.442430210829963, `58` = -0.450058317913238, 
`59` = -0.457686424996513, `60` = -0.465314532079788, `61` = -0.472942639163064, 
`62` = -0.480570746246339, `63` = -0.488198853329614, `64` = -0.495826960412889, 
`65` = -0.503455067496165, `66` = -0.51108317457944, `67` = -0.518711281662715, 
`68` = -0.52633938874599, `69` = -0.533967495829265, `70` = -0.541595602912541, 
`71` = -0.549223709995816, `72` = -0.556851817079091, `73` = -0.564479924162366, 
`74` = -0.572108031245641, `75` = -0.579736138328917, `76` = -0.587364245412192, 
`77` = -0.594992352495467, `78` = -0.602620459578742, `79` = -0.610248566662018, 
`80` = -0.617876673745293, `81` = -0.625504780828568, `82` = -0.633132887911843, 
`83` = -0.640760994995118, `84` = -0.648389102078394, `85` = -0.656017209161669, 
`86` = -0.663645316244944, `87` = -0.671273423328219, `88` = -0.678901530411494, 
`89` = -0.68652963749477, `90` = -0.694157744578045, `91` = -0.70178585166132, 
`92` = -0.709413958744595, `93` = -0.717042065827871, `94` = -0.724670172911146, 
`95` = -0.732298279994421, `96` = -0.739926387077696, `97` = -0.747554494160972, 
`98` = -0.755182601244247, `99` = -0.762810708327522, `100` = -0.770438815410797, 
`101` = -0.778066922494072, `102` = -0.785695029577348, `103` = -0.793323136660623, 
`104` = -0.800951243743898, `105` = -0.808579350827173, `106` = -0.816207457910448, 
`107` = -0.823835564993724, `108` = -0.831463672076999, `109` = -0.839091779160274, 
`110` = -0.846719886243549, `111` = -0.854347993326825, `112` = -0.8619761004101, 
`113` = -0.869604207493375, `114` = -0.87723231457665, `115` = -0.884860421659926, 
`116` = -0.892488528743201, `117` = -0.900116635826476, `118` = -0.907744742909751, 
`119` = -0.915372849993026), points = c(`1` = 33.2720778855054, 
`2` = 32.9901111237639, `3` = 32.7081443620223, `4` = 32.4261776002807, 
`5` = 32.1442108385391, `6` = 31.8622440767976, `7` = 31.580277315056, 
`8` = 31.2983105533144, `9` = 31.0163437915729, `10` = 30.7343770298313, 
`11` = 30.4524102680897, `12` = 30.1704435063481, `13` = 29.8884767446066, 
`14` = 29.606509982865, `15` = 29.3245432211234, `16` = 29.0425764593819, 
`17` = 28.7606096976403, `18` = 28.4786429358987, `19` = 28.1966761741571, 
`20` = 27.9147094124156, `21` = 27.632742650674, `22` = 27.3507758889324, 
`23` = 27.0688091271909, `24` = 26.7868423654493, `25` = 26.5048756037077, 
`26` = 26.2229088419661, `27` = 25.9409420802246, `28` = 25.658975318483, 
`29` = 25.3770085567414, `30` = 25.0950417949999, `31` = 24.8130750332583, 
`32` = 24.5311082715167, `33` = 24.2491415097751, `34` = 23.9671747480336, 
`35` = 23.685207986292, `36` = 23.4032412245504, `37` = 23.1212744628089, 
`38` = 22.8393077010673, `39` = 22.5573409393257, `40` = 22.2753741775841, 
`41` = 21.9934074158426, `42` = 21.711440654101, `43` = 21.4294738923594, 
`44` = 21.1475071306179, `45` = 20.8655403688763, `46` = 20.5835736071347, 
`47` = 20.3016068453931, `48` = 20.0196400836516, `49` = 19.73767332191, 
`50` = 19.4557065601684, `51` = 19.1737397984269, `52` = 18.8917730366853, 
`53` = 18.6098062749437, `54` = 18.3278395132021, `55` = 18.0458727514606, 
`56` = 17.763905989719, `57` = 17.4819392279774, `58` = 17.1999724662359, 
`59` = 16.9180057044943, `60` = 16.6360389427527, `61` = 16.3540721810111, 
`62` = 16.0721054192696, `63` = 15.790138657528, `64` = 15.5081718957864, 
`65` = 15.2262051340449, `66` = 14.9442383723033, `67` = 14.6622716105617, 
`68` = 14.3803048488201, `69` = 14.0983380870786, `70` = 13.816371325337, 
`71` = 13.5344045635954, `72` = 13.2524378018539, `73` = 12.9704710401123, 
`74` = 12.6885042783707, `75` = 12.4065375166291, `76` = 12.1245707548876, 
`77` = 11.842603993146, `78` = 11.5606372314044, `79` = 11.2786704696629, 
`80` = 10.9967037079213, `81` = 10.7147369461797, `82` = 10.4327701844381, 
`83` = 10.1508034226966, `84` = 9.868836660955, `85` = 9.58686989921343, 
`86` = 9.30490313747186, `87` = 9.02293637573029, `88` = 8.74096961398872, 
`89` = 8.45900285224714, `90` = 8.17703609050557, `91` = 7.895069328764, 
`92` = 7.61310256702243, `93` = 7.33113580528086, `94` = 7.04916904353929, 
`95` = 6.76720228179771, `96` = 6.48523552005614, `97` = 6.20326875831457, 
`98` = 5.921301996573, `99` = 5.63933523483143, `100` = 5.35736847308986, 
`101` = 5.07540171134829, `102` = 4.79343494960672, `103` = 4.51146818786514, 
`104` = 4.22950142612357, `105` = 3.947534664382, `106` = 3.66556790264043, 
`107` = 3.38360114089886, `108` = 3.10163437915729, `109` = 2.81966761741572, 
`110` = 2.53770085567415, `111` = 2.25573409393257, `112` = 1.973767332191, 
`113` = 1.69180057044943, `114` = 1.40983380870786, `115` = 1.12786704696629, 
`116` = 0.845900285224714, `117` = 0.563933523483143, `118` = 0.281966761741571, 
`119` = 0)), info = list(nfun = 3L, predictor = "n_fjernet", 
    effect.name = "n_fjernet", type = "main")), structure(list(
    n_sygdom = c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 
    14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
    29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40), Xbeta = c(`120` = 0, 
    `121` = 0.289782888103146, `122` = 0.597659631547995, `123` = 0.847429207013489, 
    `124` = 1.02887445686286, `125` = 1.15566024621933, `126` = 1.24145144020613, 
    `127` = 1.29991290394648, `128` = 1.3447095025636, `129` = 1.38722862366018, 
    `130` = 1.42974774475677, `131` = 1.47226686585336, `132` = 1.51478598694994, 
    `133` = 1.55730510804654, `134` = 1.59982422914312, `135` = 1.64234335023972, 
    `136` = 1.6848624713363, `137` = 1.72738159243285, `138` = 1.76990071352946, 
    `139` = 1.81241983462605, `140` = 1.85493895572266, `141` = 1.89745807681922, 
    `142` = 1.93997719791581, `143` = 1.98249631901238, `144` = 2.02501544010901, 
    `145` = 2.06753456120562, `146` = 2.11005368230218, `147` = 2.15257280339881, 
    `148` = 2.19509192449543, `149` = 2.23761104559199, `150` = 2.2801301666886, 
    `151` = 2.32264928778508, `152` = 2.36516840888183, `153` = 2.40768752997815, 
    `154` = 2.45020665107478, `155` = 2.49272577217142, `156` = 2.53524489326801, 
    `157` = 2.57776401436475, `158` = 2.62028313546134, `159` = 2.66280225655792, 
    `160` = 2.70532137765463), points = c(`120` = 0, `121` = 10.7115882976674, 
    `122` = 22.0920012122972, `123` = 31.3245300175082, `124` = 38.0315058078179, 
    `125` = 42.7180391862067, `126` = 45.8892407556548, `127` = 48.0502211191424, 
    `128` = 49.7060908796498, `129` = 51.2777755396602, `130` = 52.8494601996709, 
    `131` = 54.4211448596817, `132` = 55.9928295196922, `133` = 57.5645141797031, 
    `134` = 59.1361988397135, `135` = 60.7078834997246, `136` = 62.2795681597352, 
    `137` = 63.8512528197446, `138` = 65.422937479756, `139` = 66.9946221397666, 
    `140` = 68.5663067997782, `141` = 70.1379914597879, `142` = 71.7096761197985, 
    `143` = 73.2813607798086, `144` = 74.8530454398212, `145` = 76.4247300998324, 
    `146` = 77.9964147598421, `147` = 79.5680994198545, `148` = 81.1397840798663, 
    `149` = 82.7114687398759, `150` = 84.2831533998875, `151` = 85.8548380598941, 
    `152` = 87.4265227199109, `153` = 88.9982073799118, `154` = 90.5698920399238, 
    `155` = 92.1415766999367, `156` = 93.7132613599473, `157` = 95.2849460199637, 
    `158` = 96.8566306799743, `159` = 98.428315339985, `160` = 100
    )), info = list(nfun = 3L, predictor = "n_sygdom", effect.name = "n_sygdom", 
    type = "main")), structure(list(ecs = c("No", "Yes"), Xbeta = c(`161` = 0, 
`162` = 0.311111953690113), points = c(`161` = 0, `162` = 11.4999998247835
)), info = list(nfun = 3L, predictor = "ecs", effect.name = "ecs", 
    type = "main")), structure(list(contra_pos = c("Ipsi.", "Contra."
), Xbeta = c(`163` = 0, `164` = -0.139442361056046), points = c(`163` = 5.15437323668122, 
`164` = 0)), info = list(nfun = 3L, predictor = "contra_pos", 
    effect.name = "contra_pos", type = "main")), list(x = c(0, 
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140)), 
    list(x = c(-8.14452801469555, 10.3375645059895, 28.8196570266746, 
    47.3017495473596, 65.7838420680447, 84.2659345887298, 102.748027109415, 
    121.2301196301, 139.712212150785), x.real = c(-1.5, -1, -0.5, 
    0, 0.5, 1, 1.5, 2, 2.5)), list(x = c(133.253056210811, 122.523862453927, 
    112.430840978251, 102.114459495373, 90.8324450279162, 77.5548046068363, 
    60.2182329183346, 32.4792532034398), x.real = c(0.2, 0.3, 
    0.4, 0.5, 0.6, 0.7, 0.8, 0.9), fat = c("0.2", "0.3", "0.4", 
    "0.5", "0.6", "0.7", "0.8", "0.9"), which = c(FALSE, TRUE, 
    TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE)), list(x = c(112.024963827927, 
    98.7863551985778, 88.0571515041272, 77.9641378681437, 67.6477499654811, 
    56.3657514459693, 43.0880807889333, 25.7515453011765, -1.98744879901151
    ), x.real = c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9
    ), fat = c("0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", 
    "0.8", "0.9"), which = c(FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, 
    TRUE, TRUE, TRUE, TRUE, FALSE)), list(x = c(97.0648415571574, 
    83.8262076192369, 73.0970097888707, 63.0039908791831, 52.6876103537277, 
    41.4055979851762, 28.1279463383259, 10.7913911577688), x.real = c(0.1, 
    0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8), fat = c("0.1", "0.2", 
    "0.3", "0.4", "0.5", "0.6", "0.7", "0.8"), which = c(FALSE, 
    TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE))), .Names = c("n_fjernet", 
"n_sygdom", "ecs", "contra_pos", "total.points", "lp", "Probability of 1 year survival", 
"Probability of 5 years survival", NA), info = list(fun = list(
    function (x) 
    surv(12, x), function (x) 
    surv(36, x), function (x) 
    surv(60, x)), lp = TRUE, lp.at = c(-1.5, -1, -0.5, 0, 0.5, 
1, 1.5, 2, 2.5), discrete = c(n_fjernet = FALSE, n_sygdom = FALSE, 
ecs = TRUE, contra_pos = TRUE, studie = TRUE), funlabel = c("Probability of 1 year survival", 
"Probability of 5 years survival"), fun.at = NULL, fun.lp.at = NULL, 
    Abbrev = list(), minlength = 4, conf.int = FALSE, R = structure(c(-0.915372849993026, 
    -0.0152562141665504, 0, 2.70532137765463, 0, 0.311111953690113, 
    -0.139442361056046, 0), .Dim = c(2L, 4L), .Dimnames = list(
        NULL, c("n_fjernet", "n_sygdom", "ecs", "contra_pos"))), 
    sc = 36.9641850413701, maxscale = 100, Intercept = -1.27966434250937, 
    nint = 10, space.used = c(main = 4, ia = 0)), class = "nomogram")
4

0 回答 0