ilm: Improper (generalized) linear model

Description Usage Arguments References See Also Examples

View source: R/ilm.R

Description

ilm is used for fitting improper linear models (unit-weighted regression, equal-weights models, model with correlation weights, Z-score method, random linear models). Univariate model reduces to univariate linear regression. iglm extends ilm functionality to generalized linear models.

Usage

1
2
3
4
5
6
7
8
9
iglm(formula, data, family = gaussian, scaling = c("none", "zscore",
  "minmax", "medmad"), weighting = 1)

iglm.fit(x, y, family = gaussian(), scaling = "none", weighting = 1)

ilm(formula, data, scaling = c("none", "zscore", "minmax", "medmad"),
  weighting = 1)

ilm.fit(x, y, scaling = "none", weighting = 1)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which ilm or iglm is called.

family

a description of the error distribution and link function to be used in the model. For glm this can be a character string naming a family function, a family function or the result of a call to a family function. For glm.fit only the third option is supported. (See family for details of family functions.)

scaling

method of scaling to be used. Possible choices are: "none" for no scaling; "zscore" for transforming into Z-scores; "minmax" for scaling into [0, 1] range; and "medmad" for subtracting median and dividing by MAD. See: scale.

weighting

weights to be applied to all the variables (notice: this is different than weights parameter in lm etc.). Possible values are: single scalar (1 by default); a vector of the same length as number of variables in the left hand side of formula (e.g. runif(5) for five weights in random linear model with five predictors); "cor" for multiplying every variable by its correlation with variable on the left hand side of formula; "sign" for unit weights such that positively correlated variables get weight 1 and negatively -1; "lmsign" for unit weights similar to "sign" but created by taking signs of coefficients from (generalized) linear model; or a function (applied column-wise) to each of the variables in the left hand side of formula (e.g. function(x) 1/sd(x)).

References

Dawes, Robyn M. (1979). The robust beauty of improper linear models in decision making. American Psychologist, 34, 571-582.

Graefe, A. (2015). Improving forecasts using equally weighted predictors. Journal of Business Research, 68(8), 1792-1799.

Wainer, Howard (1976). Estimating coefficients in linear models: It don't make no nevermind. Psychological Bulletin 83(2), 213.

Dana, J. and Dawes, R.M. (2004). The Superiority of Simple Alternatives to Regression for Social Science Predictions. Journal of Educational and Behavioral Statistics, 29(3), 317-331.

See Also

lm, lm.fit, glm, glm.fit, scale

Examples

1
2
3
4
5
6
7
8
9
fit1 <- ilm(cyl ~ mpg + drat + am, data = mtcars)

print(fit1)
summary(fit1)

fit2 <- iglm(am ~ ., data = mtcars, family = binomial)

print(fit2)
summary(fit2)

twolodzko/improper documentation built on May 3, 2019, 1:52 p.m.