gls_cs: Cross-sectional FoSR using GLS

Description Usage Arguments Author(s) References Examples

Description

Fitting function for function-on-scalar regression for cross-sectional data. This function estimates model parameters using GLS: first, an OLS estimate of spline coefficients is estimated; second, the residual covariance is estimated using an FPC decomposition of the OLS residual curves; finally, a GLS estimate of spline coefficients is estimated. Although this is in the 'BayesFoSR' package, there is nothing Bayesian about this FoSR.

Usage

1
2
gls_cs(formula, data = NULL, Kt = 5, basis = "bs", sigma = NULL,
  verbose = TRUE, CI.type = "pointwise")

Arguments

formula

a formula indicating the structure of the proposed model.

data

an optional data frame, list or environment containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which the function is called.

Kt

number of spline basis functions used to estimate coefficient functions

basis

basis type; options are "bs" for b-splines and "pbs" for periodic b-splines

sigma

optional covariance matrix used in GLS; if NULL, OLS will be used to estimated fixed effects, and the covariance matrix will be estimated from the residuals.

verbose

logical defaulting to TRUE – should updates on progress be printed?

CI.type

Indicates CI type for coefficient functions; options are "pointwise" and "simultaneous"

Author(s)

Jeff Goldsmith ajg2202@cumc.columbia.edu

References

Goldsmith, J., Kitago, T. (Under Review). Assessing Systematic Effects of Stroke on Motor Control using Hierarchical Function-on-Scalar Regression.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(refund)
library(dplyr)

data(DTI)
DTI = subset(DTI, select = c(cca, case, pasat))
DTI = DTI[complete.cases(DTI),]
DTI$gender = factor(sample(c("male","female"), dim(DTI)[1], replace = TRUE))
DTI$status = factor(sample(c("RRMS", "SPMS", "PPMS"), dim(DTI)[1], replace = TRUE))

fosr.dti = fosr_gls(cca ~ pasat * gender + status, data = DTI)

jeff-goldsmith/BayesFoSR documentation built on May 19, 2019, 1:45 a.m.