05 Create Composite Variable

To do inferential statistics (Information Theory), you may be interested in interaction terms between 2 more variables.

Create 2 set of random variables

set.seed(1034)

series1 = rnorm(1000000)

hist(series1)

summary(series1)

Create a second series of normal variable

set.seed(6098)

series2 = rnorm(1000000)

hist(series2)

summary(series2)

Create new series that is a mean of two above series.

series.mean = (series1 + series2)/2

hist(series.mean)

Multiple of series1 and series2.

series.mul = series1 * series2

hist(series.mul)

Let's look at kurtosis to understand the peakedness of frequency distribution.

require(psych)

describe(series.mul)

Compare the kurtosis value between series.mul and series1. Higher the value of kurtosis, more peaked is the data.