Description Usage Arguments Details Value Examples

View source: R/tree_evaluation.R

Returns a matrix of spline coefficients for each observation in the testset. If no testset is provided, returns predicted coefficients for the individuals in training set; in this case, the columns of the returned predictions correspond to the rows of the flattened training dataset (found in tree$parms$flat_data).

1 | ```
predictCoeffs(tree, testset = tree$parms$flat_data)
``` |

`tree` |
A model created with splineTree() |

`testset` |
The dataset to predict coefficients for. Default is the flattened dataset used to make the tree. |

importFrom treeClust rpart.predict.leaves

A matrix of spline coefficients. The dimension of the matrix is the degrees of freedom of the spline by the number of units in the test set. The ith column of the matrix holds the predicted coefficients for the ith row in the testset.

1 2 3 4 5 6 | ```
split_formula <- ~HISP + WHITE + BLACK + SEX + Num_sibs + HGC_FATHER + HGC_MOTHER
tree <- splineTree(split_formula, BMI~AGE, idvar = "ID",
data = nlsySample, degree = 1, df = 3,
intercept = TRUE, cp = 0.005)
preds <- predictCoeffs(tree)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.