fitBspline: Compute B-Spline Basis for Data

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fitBspline.R

Description

Provides a heuristic framework for fitting a set of B-spline basis functions to a set of data points under the constraint of a limited number of degrees of freedom.

Usage

1
fitBspline(dataValues, continuousCovariates, indicators, group, covariate)

Arguments

dataValues

A vector of data points to which the spline is to be fit.

continuousCovariates

Vector that contains all the continuous variables whose coefficients must be estimated in this model.

indicators

This vector contains all the indicator variables whose coefficients will also be estimated in the model. The number of parameters in indicators and continuousCovariates together with the length of dataValues determine the available number of degrees of freedom for the fitting of the spline.

group

String denoting the subgroup from which the measurements of these dataValues are coming.

covariate

String denoting the variable that is being measured by the dataValues.

Details

This method is intended for users who do not wish to specify B-spline properties. It adopts the heuristic of modified equipotent arrangement put forth by Yanagihara and Ohtaki (1991) in selecting knot-placement of the splines.

Value

Uses the return format of bs in the splines package, which is a matrix corresponding to the values of each fitted B-spline basis function evaluated at each point in dataValues.

Author(s)

Jonas Mueller

References

Yanagihara, H. and Ohtaki, M. Knot-Placement to Avoid Over Fitting in B-Spline Scedastic Smoothing. Communications in Statistics, 32, 771-85 (1991).

See Also

splines for a basic B-spline package on which fitBspline heavily relies.

Examples

1
2
3
4
5
6
data = runif(n = 30, min = 50, max = 100)
variables = c("height", "weight", "insulin")
indicators = c("sex", "diseased")
subgroup = "diabetes"
covariate = "height"
BsplineFit = fitBspline(data, variables, indicators, subgroup, covariate)

plmDE documentation built on May 29, 2017, 6:37 p.m.