Hi Good Morning
here is the code having reference to the dataset as well. I have used "dat.bcg" dataset builtin with library(metafor). Thank you for your support
#############################################
library(shiny)
ui <- fluidPage(
fluidRow(
align = "center",
column(style = "border: 4px double red;height: 525px;overflow-y: auto;",
width = 3,
aligh = "center",
br(),
selectInput(inputId = 'mModeratorVar',label = 'Select Moderator',choices = c('ablat','alloc'),selected='alloc',multiple = FALSE)
),
column(style = "border: 4px double red;height: 525px;overflow-y: auto;",
width = 9,
HTML(paste('<h4><b>',"Meta Regression",'<h5></b>')),
verbatimTextOutput('mMetaRegressionTxt2')
)
) #fluid row
)
server <- function(input, output, session) {
library(metafor)
data("dat.bcg")
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
output$mMetaRegressionTxt2 <- renderPrint({
rma(yi, vi, mods = ~ factor(dat[,input$mModeratorVar]), data=dat)
})
}
shinyApp(ui, server)
#############################################################
for me output is showing like this
output is required like this: I need name of the variable to be shown instead of Input$mModeratorVar