Mixed_Spline_Fit_Single: Fitting single dataset with mixed models and splines

Description Usage Arguments Details Value References See Also Examples

Description

This function fits a mixed model.

Usage

1

Arguments

x

A vector of a predictor variable.

y

A vector of dependent variable

model

A list containing Z_p, the matrix formed from a spline basis, and X_p, the matrix formed to fit the trend. Z_p is associated with the random effects and X_p is associated with the fixed effects.

Details

Must provide a model.

Value

fit is the vector of fitted values. coeff_fix is the vector of fixed effects coefficients. coeff_rand is the vector of random effects coefficients.

References

\insertRef

wand2003unequalgroupoutlier

See Also

Mixed_Spline_Model for how to create a model.

Examples

1
2
3
4
5
6
knots <- seq(1, 1000, len = 40)
x <- c(1:1000)
y <- rnorm(1000, x, 25)
model <- Mixed_Spline_Model(x, knots, P = 1)
fit <- Mixed_Splinefit(x, y , model)
plot(fit$fit, type = "l")

cshannum/unequalgroupoutlier documentation built on May 13, 2019, 11:10 a.m.