mwlsr: mwlsr

Description Usage Arguments Value Examples

Description

Multiple Weighted Least Squares Regression (mwlsr). Used to fit gaussian glm against multiple responses simultaneously.

Usage

1
2
3
mwlsr(data, design, weights = NULL, scale.weights = TRUE, data.err = NULL,
  coef.method = c("chol", "ginv", "svd", "qr"), coef.tol = 1e-07,
  coefs.only = FALSE)

Arguments

data

Input response matrix with responses in columns

design

Design matrix. See model.matrix

weights

Weights matrix

scale.weights

If TRUE then weights are scaled (default behavior)

data.err

Additional per-response-value uncertainty that should be considered in the final sum of squared residual. Useful if your response values have some knowm measurement uncertainty that you'd like to have considered in the models.

coef.method

Method used to compute coefficients. This setting is passed to mols.coefs or wls.coefs

coef.tol

Tolerance setting for svd based coefficient calculation. Passed to mols.coefs or wls.coefs

coefs.only

Stop at the coefficient calculation and return only the coefficients of the models.

Value

List with the following elements:

coefficients

Model coefficients

residuals

Residuals of the fit

fitted.values

Fitted values. Same dimension as the input response matrix.

deviance

Sum of squared residuals

dispersion

deviance / df.residual

null.deviance

Sum of squared residuals for the NULL model (intercept only)

weights

Weights matrix

prior.weights

Weights matrix pre-scaling

weighted

TRUE if fit was a weighted fit

df.residual

Degrees of freedom of the model. nrows(data) - ncol(design)

df.null

Degrees of freedom of the null model. nrows(data) - 1

y

Input data matrix

y.err

Input data.err matrix

X

Design matrix

x

If design matrix was based on factor levels then this will be a factor vector that matches the original grouping vector

intercept

TRUE if the fit has an Intercept

coef.hat

If the fit has an Intercept then this is a matrix of modified coefficients that represent the per-group averages. This is calculated by adding the Intercept coefficients to each of the other coefficients. This only makes sense if your design was based on a single multi-level factor

Examples

1
2
3
4
5
6
# Using the iris data.
design <- model.matrix(~Species, data=iris)
fit <- mwlsr(iris[, 1:4], design)
# test data association with the Species factor
result <- mwlsr.Ftest(fit)
print(table(result$F.padj < 0.05))

PfaffLab/mwlsr documentation built on May 12, 2019, 5:22 p.m.