Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_quantiles

Expand samples with quantiles


Description

TO DO: implement using fitted() and predict() but avoid double-computing the samples? E.g.: get_quantiles2 = function(fit, quantiles, facet_by = NULL) { fitted(fit, probs = c(0.1, 0.5, 0.9), newdata = data.frame(x = c(11, 50, 100))) %>% tidyr::pivot_longer(tidyselect::starts_with("Q")) %>% dplyr::mutate(quantile = stringr::str_remove(name, "Q") %>% as.numeric() / 100) }

Usage

get_quantiles(samples, quantiles, xvar, yvar, facet_by = NULL)

Arguments

samples

A tidybayes tibble

quantiles

Vector of quantiles (0.0 to 1.0)

xvar

An rlang::sym() with the name of the x-col in samples

yvar

An rlang::sym() with the name of the response col in samples

facet_by

String. Name of a varying group.

Value

A tidybayes long format tibble with the column "quantile"

Author(s)

Jonas Kristoffer Lindeløv jonas@lindeloev.dk


mcp

Regression with Multiple Change Points

v0.3.0
GPL-2
Authors
Jonas Kristoffer Lindeløv [aut, cre] (<https://orcid.org/0000-0003-4565-0595>)
Initial release
2020-07-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.