# R - Formula ( ~ tilde)

A formula in S is indicated by the ~ character.

?formula

## Design Matrix

A formula is commonly used to generate design matrices for modeling function (e.g. lm).

``````mod1 <- lm(Sepal.Width ~ Petal.Width + log(Petal.Length) + Species,
data = iris, subset = Sepal.Length > 4.6)```
```

## Documentation / Reference

Discover More
R - Plot (Graphic System)

The general form of a formula specifying a plot is where: y is the coordinate on the vertical axis, x is the coordinate on the horizontal axis, and g is a grouping factor or expression. For...
R - Shrinkage Method (Ridge Regression and Lasso)

Unlike subset and forward stepwise regression, which controls the complexity of a model by restricting the number of variables, ridge regression keeps all the variables in and shrinks the coefficients...
R - Tilde Operator

A formula in S is indicated by the tilde character. The Tilde operator separate the left- and right-hand sides in a model formula. where: The left hand is a dependent variable) The right hand is...
Statistics - Design Matrix (X)

The design matrix is a representation of the explanatory variables (a.k.a. the X matrix) where: instances of data are in rows and variable attributes are in columns . In R: model.matrix...