sfModel: Fit single factor models

Description Usage Arguments Value Examples

View source: R/Fitting.R

Description

Fit single factor models

Usage

1
2
sfModel(formula, data, response, factor, time, constrained = FALSE,
  save.data = TRUE, correlation = NULL)

Arguments

formula

a formula of the form y ~ factor + time

data

a data frame in which formula is evaluated

constrained

a logical indicating whether the model parameters are constrained

correlation

an optional nlme::corStruct object describing the within-group correlation structure. See the documentation of nlme::corClasses for a description of the available nlme::corStruct classes. If a grouping variable is to be used, it must be specified in the form argument to the nlme::corStruct constructor. Defaults to NULL, corresponding to uncorrelated errors.

Value

an lm object with some additional attributes

Examples

1
2
3
data(EconUK)
sfModel(iGDP ~ iK + iYear, data = EconUK)
sfModel(response = "iGDP", factor = "iK", time = "iYear", data = EconUK)

EconModels/MacroGrowth documentation built on Dec. 17, 2019, 10:41 p.m.