Description Usage Arguments Value Examples

Plot spline curves

1 | ```
viewSplines(knots, degree, theta)
``` |

`knots` |
A vector of values between 0 and 1, specifying cut-points for splines |

`degree` |
Integer specifying degree of curvature. |

`theta` |
A vector or matrix of values between 0 and 1. Each column of the matrix represents the weights/coefficients that will be applied to the basis functions determined by the knots and degree. Each column of theta represents a separate spline curve. |

A ggplot object that contains a plot of the spline curves. The number of spline curves in the plot will equal the number of columns in the matrix (or it will equal 1 if theta is a vector).

1 2 3 4 5 6 7 8 9 10 11 12 | ```
knots <- c(0.25, 0.5, 0.75)
theta1 = c(0.1, 0.8, 0.4, 0.9, 0.2, 1.0)
viewSplines(knots, degree = 2, theta1)
theta2 = matrix(c(0.1, 0.2, 0.4, 0.9, 0.2, 0.3,
0.1, 0.3, 0.3, 0.8, 1.0, 0.9,
0.1, 0.4, 0.3, 0.8, 0.7, 0.5,
0.1, 0.9, 0.8, 0.2, 0.1, 0.6),
ncol = 4)
viewSplines(knots, degree = 2, theta2)
``` |

kgoldfeld/simstudy documentation built on Dec. 23, 2018, 5:33 a.m.

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.