tidypredict_sql_interval

Returns a SQL query with formula to calculate predicted interval

tidypredict_sql_interval(model, con, interval = 0.95)

Arguments

model

An R model or a tibble with a parsed model

con

Database connection object. It is used to select the correct SQL translation syntax.

interval

The prediction interval, defaults to 0.95

Examples

library(dbplyr) model <- lm(mpg ~ wt + am + cyl, data = mtcars) tidypredict_sql_interval(model, simulate_dbi())
#> <SQL> (2.04840714179524) * SQRT((((((-0.176776695296637) * (-0.176776695296637) * (6.8231093058295)) + (((-0.590557271637747) + (("wt") * (0.183559646169165))) * ((-0.590557271637747) + (("wt") * (0.183559646169165))) * (6.8231093058295))) + ((((0.769566489443368) + (("wt") * (-0.176199380745393))) + (("am") * (-0.498926847360626))) * (((0.769566489443368) + (("wt") * (-0.176199380745393))) + (("am") * (-0.498926847360626))) * (6.8231093058295))) + (((((-0.224404416240186) + (("wt") * (-0.23845787029348))) + (("am") * (-0.0214203331902853))) + (("cyl") * (0.161662223806132))) * ((((-0.224404416240186) + (("wt") * (-0.23845787029348))) + (("am") * (-0.0214203331902853))) + (("cyl") * (0.161662223806132))) * (6.8231093058295))) + (6.8231093058295))
Skip to content This repository Search Pull requests Issues Marketplace Explore @edgararuiz Sign out Unwatch 9 Star 5 Fork 5 rstudio/db.rstudio.com Code Issues 6 Pull requests 0 Projects 0 Wiki Insights Settings Tree: 7a7548589f Find file Copy pathdb.rstudio.com/themes/hugo-material-docs/layouts/partials/footer_js.html 7a75485 on Apr 22, 2017 @edgararuiz edgararuiz Fix to theme's scrollspy 1 contributor RawBlameHistory 84 lines (73 sloc) 2.83 KB © 2018 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub API Training Shop Blog About