Error in Shiny App

Hello,

I'm building a simple regression model to Shiny and looks like my server code has some errors. My UI is fine but when launching the app, it keeps showing me this error:

"no applicable method for 'svyglm' applied to an object of class "data.frame"

Can someone help me out with this? Thank you and appreciate. My codes as below

place.data <- read.csv("place_data.csv")

server <- function(input, output) {
  model <- reactive({
    
    svyglm(paste("Risk"," ~ ",paste(input$iv1,collapse="+")),family= quasibinomial, place.data)
    
  })
  
  output$regTab <- renderText({
    stargazer(model(), type = "html", dep.var.labels = "Risk Prediction")
  })
  
}
  
           
ui <- shinyUI(fluidPage(tabPanel(
  "Analyzing ACEs",
  headerPanel("ACEs Prediction Model"),
  sidebarLayout(
    position = "right",
    sidebarPanel(
      h2("Build your model"),
      br(),
      checkboxGroupInput(
        "iv1",
        label = "Select any of the independent variables below to calculate your model. You can change your selection at any time.",
        c("Risk"="Risk", 
          "Poverty"="Poverty", 
          "Education"="Education",
          "Unemployment"="Unemployment",
          "Crime"="Crime", 
          "ACEs" = "ACEs"),
        selected = "Risk"
      )
    ),
    
    
    mainPanel(br(),
              tabsetPanel(
                type = "tabs",
                tabPanel(
                  "Regression Table",
                  h3("Table of Regression Coefficients"),
                  HTML('</br>'),
                  tableOutput("regTab"),
                  HTML('</br>'),
                  helpText("Describe the model")
                )
              )
    )
  )
)
)
)



shinyApp(ui = ui, server = server)

Hi! It seems the problem is coming from yout call to svyglm(), specifically from the place.data object you are passing as an argument.

Were you able to fit this model outside your shiny app successfully?

In any case, I would take a look at the reference for the svyglm() function. It seems the arguments that you are passing might be off.

Aww Thank you Agus for mentioning, I figured it out. I used the function lm instead and it worked ! Thank you so much for your help!