Description Usage Arguments Value Examples
This function separates out the function calls uSpline()
and
uSplines()
potentially embedded in the MTR formulas from the
rest of the formula. The terms involving splines are treated
separately from the terms that do not involve splines when creating
the gamma moments.
1 | removeSplines(formula, env = parent.frame())
|
formula |
the formula that is to be parsed. |
env |
environment in which to formulas. This is necessary as
splines may be declared using objects, e.g. |
a list containing two objects. One object is formula
but with the spline components removed. The second object is a
list. The name of each element is the
uSpline()
/uSplines()
command, and the elements
are a vector of the names of covariates that were interacted
with the uSpline()
/uSplines()
command.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Declare and MTR with a sline component.
m0 = ~ x1 + x1 : uSpline(degree = 2,
knots = c(0.2, 0.4)) +
x2 : uSpline(degree = 2,
knots = c(0.2, 0.4)) +
x1 : x2 : uSpline(degree = 2,
knots = c(0.2, 0.4)) +
uSpline(degree = 3,
knots = c(0.2, 0.4),
intercept = FALSE)
## Now separate the spline component from the non-spline component
removeSplines(m0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.