wlm: GLS/WLS using lm.

Description Usage Arguments Value Examples

View source: R/wlm.R

Description

GLS/WLS using lm.

Usage

1
2
wlm(formula, data, ..., varcov = NULL, transform = NULL,
  dtol = decompose_tol(), dmethod = decompose_method(), verbose = 0)

Arguments

formula

Formula.

data

Data.

...

Arguments passed to lm.

varcov

Variance-covariance (relative) matrix of residuals.

dtol

Tolerance for decompose_varcov. The default value is output of decompose_tol function.

dmethod

One of the following methods for decomposition: "evd", "chol_evd" or "chol".

Value

A modified output of lm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# @ http://www.biostat.jhsph.edu/~iruczins/teaching/jf/ch5.pdf

# data
data(longley)
nobs <- nrow(longley)

rho <- 0.64417
V <- diag(nobs)
V <- rho^abs(row(V) - col(V))
  
mod <- wlm(Employed ~ GNP + Population, data = longley, varcov = V)

variani/wls documentation built on May 3, 2019, 4:34 p.m.