What is The Use of Tilde in R? Tilde (~) Operator

Tilde operator is used in statistical formulas where we need to define the relationship between a dependent variable and an independent variable.

Variables on the left-hand side of tilde are considered as dependent variable and variables on right-hand-side of tilde is are called independent variables.

> Regression_Model_relationship <- qa(y~ n1 + n2 + n3)

In the above equation, we have the object Regression_Model_relationship that stores the formula for linear regression and created by qa and y. So, qa and y are on the left-hand side of tilde are dependent variables, and n1, n2, and n3 are independent variables.

Examples of Tilde Operator  in R

> Regression_Data_relationship <- data.frame(n1, n2, n3, y)
> Regression_Model__relationship_New < - qa(y~ . , data = Regression_Data_relationship)

Leave a Comment

4 + 20 =