Exercise

# Row vector of means and matrix of means

Now that you have the row vector of sums `t_mat`

, a 1-by-3 matrix, you are ready to construct the row vector of means `M`

via:

$$\begin{aligned} M_{1p} &= T_{1p} N^{-1} \end{aligned}$$

with \(M_{1p}\) the 1-by-p row vector of means, \(T_{1p}\) the 1-by-p row vector of sums, and \(N^{-1}\) the inverse number of observations for each variable.

Given the row vector of means `M`

, you can also construct the matrix of means `MM`

by multiplying the row vector of means with a column vector:

$$\begin{aligned} MM_{np} &=1_{n1}M_{1p} \end{aligned}$$

with \(MM_{np}\) the n-by-p matrix of means, \(M_{1p}\) the 1-by-p row vector of means, and \(1_{n1}\) a n-by-1 column vector.

Instructions

**100 XP**

- Compute the
**row vector of means**(`M`

) using the row vector of sums (`t_mat`

) you calculated in the previous exercise. - Construct the
**mean matrix of means**(`MM`

). First create an additional matrix`J`

with`J`

a 10x1 column matrix of which the elements are all 1.