Description Usage Arguments Value Author(s) See Also Examples
View source: R/make_basis_matrix.R
Takes a vector of x-values and a basis type ("tent" and "poly" are current options) and returns a design matrix for fitting a piecewise linear mixed effects model with one group. Basis created uses the so-called "tent-functions". See, e.g., Simon Wood (2017) GAM 2nd edition text, section 4.2, page 164-166.
1 2 3 4 5 6 7 8 9 10 |
x |
numeric vector of values to use in forming the basis. |
basis |
character string specifying which kind of basis to generate. |
break_points |
numeric vector with the x-locations at which to place break points. |
add_column_names |
logical whether to add column names to the matrix. |
format_digits |
how many digits to retain in column names? Used only if add_column_names is TRUE |
degree |
numeric degree of polynomial basis, if that is selected. Passed straight to stats::poly(). |
include_intercept |
logical whether to append an intercept term to the matrix for a polynomial basis. |
use_poly_coefs |
logical whether to use "attr( maeve_options('poly_object'), 'coef')" to scale poly basis matrix. |
a matrix
Bill Forrest forrest@gene.com
1 2 3 4 5 6 7 8 9 10 11 12 13 | ### Need to put in an actual example here.
simple_tent_basis <-
maeve:::make_basis_matrix( x = seq( 0, 1, length = 11 ),
basis = 'tent',
break_points = c( 0, 0.5, 1 )
)
##
simple_poly_basis <-
maeve:::make_basis_matrix( x = seq( 0, 1, length = 11 ),
basis = 'poly',
degree = 3
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.