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

get_formula_str

Build an R formula (as string) given a segment table (ST)


Description

You will need to replace PAR_X for whatever your x-axis observation column is called. In JAGS typically x[i_]. In R just x.

Usage

get_formula_str(ST, par_x, ytype = "ct", init = FALSE)

Arguments

ST

Tibble. Returned by get_segment_table.

par_x

String (default: NULL). Only relevant if no segments contains slope (no hint at what x is). Set this, e.g., par_x = "time".

ytype

One of "ct" (central tendency), "sigma", "ar1" (or another order), or "ma1" (or another order)

init

TRUE/FALSE. Set to TRUE for the first call. Adds segment-relative X-codings and verbose commenting of one formula

Value

A string with JAGS code.

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.