# Linear combinations

Sometimes we want to combine two variables into a single number. We can combine different variables and compare them and interpret them.

A typical example is working with a data set like,

Where,

Now, if we want to get just the carbohydrates excluding sugars, then we will want to take carbohydrates, subtract sugars, and null out the fats. Also, we will want to standardize the sugars into grams, by multiplying the milligrams by 1,000. Conventionally, this processing will be described by coefficients contained in

A linear combination (a.k.a. a linear transformation) has quite simple nomenclature. Generally, we will say that the linear combination of two variables is equivalent to some third variable. For example, the linear combination of the coefficients in

In shorthand, for a linear recombination of data with number of variables

The notation

Especially when working with multivariate data, linear combinations can be very important tools for analysis. Choosing which variables to combine is an important step in processing data. As shown above when converting from milligrams to grams, standardization is important along the way to ensure units match, when possible.

## Example of a a linear recombination

Here are some other examples of linear combinations. For a data set for a practice score, a quiz score, a midterm score, another quiz score, and a final exam score,

Where,

And let us say that we want to conduct a linear combination where the practice score is not counted, and the quizzes are altogether worth 20% of the overall score while the exams are altogether worth 80% of the overall score. This will be formatted into a vector

We will make a matrix of the overall score and call it

Or alternatively,

Then we will see a new matrix as with as many rows as the first matrix, and as many columns as the second matrix. For the sake of easier formatting, we will choose the second option, so that there is a row for each of our observations, for a total row count of

With the values for

## Getting advanced with linear combinations

Sometimes, linear combinations can be constructed which deal with various parameters,

Consider a population with mean

## Things to do with linear combination

It is common to form linear combinations, and then look for correlation between them.