# Question 3

Derive the distribution of $$L \stackrel{\sim}{\beta}$$ where $$L=a^tX$$:

We know $$\stackrel{\sim}{\beta} = AY =(X^tX)^-X^tY ~\sim N \left[ (X^tX)^- X^tX\beta ~ , ~ (X^tX)^- X^tX (X^tX)^- \sigma^2\right] ~~~~~$$ this was given; see p.62 course notes

And we know if $$Y \sim N(\mu, \sum)$$ then, $$AY \sim N(A\mu, A\sum A^t)$$, so then…

$$L \stackrel{\sim}{\beta} ~\sim N \left[ a^tX (X^tX)^- X^tX\beta ~ , ~ a^tX(X^tX)^- X^tX (X^tX)^- (a^tX)^t \sigma^2\right]$$

$$\qquad ~\sim N \left[ a^t P_x X\beta ~ , ~ a^t P_x X (X^tX)^- (a^tX)^t \sigma^2\right] ~~~~~$$ since $$X (X^tX)^- X^t = P_x$$

$$\qquad ~\sim N \left[ a^t X\beta ~ , ~ a^t X (X^tX)^- (a^tX)^t \sigma^2\right] ~~~~~$$ since $$P_x X = X$$

$$\qquad ~\sim N \left[ L\beta ~ , ~ L (X^tX)^- L^t \sigma^2\right]$$

# Question 8— [has four parts a-d]

study hint: helpful to look at the table on p.44 of the course notes

a. Determine the population mean for the myostatin group at 48 hours using the MEANS MODEL:

for reference, the generic form of the means model: $$Y_{ijk} = \mu_{jk} + \epsilon_{ijk} ~~~~~$$ for i=obs, j=time, k=group

Answer: $$\mu_{22}$$

b. Determine the population mean for the myostatin group at 48 hours using the TWO-WAY EFFECTS MODEL:

for reference, the generic form of the means model: $$Y_{ijk} = \mu + \alpha_k + \tau_j + \gamma_{jk} + \epsilon_{ijk} ~~~~~$$ for i=obs, j=time, k=group

Answer: $$\mu + \alpha_2 + \gamma_{22}$$

c. Determine the difference for the myostatin group between 48 and 72 hours using the ONE-WAY EFFECTS MODEL:

for reference, the generic form of the means model: $$Y_{ijk} = \mu + \kappa_{jk} + \epsilon_{ijk} ~~~~~$$ for i=obs, j=time, k=group

Unsimplified answer: $$(\mu + \kappa_{22}) - (\mu + \kappa_{23})$$

Answer: $$\kappa_{22} - \kappa_{23}$$

d. Determine the difference for the myostatin group between 48 and 72 hours using the TWO-WAY EFFECTS MODEL:

for reference, the generic form of the means model: $$Y_{ijk} = \mu + \alpha_k + \tau_j + \gamma_{jk} + \epsilon_{ijk} ~~~~~$$ for i=obs, j=time, k=group

Unsimplified answer: $$(\mu + \alpha_2 + \gamma_{22}) - (\mu + \alpha_2 + \gamma_{23})$$

Answer: $$\kappa_{22} - \kappa_{23}$$

# Question 9

Show that $$\stackrel{\sim}{\beta} = (X^tX)^- X^tY$$ satisfies the normal equations

# Question 11

a.1. Full Rank Model

$$Y_{ijk} = \beta_{0} + \beta_1group1_{i} + \beta_2group2_{i} + \beta_3group3_i + \beta_4time_i + \beta_5group1_i*time_i + \beta_6group2_i*time_i + \beta_7group3_i*time_i$$

$$Y_{ijk} = \mu + \alpha_{k} + \tau + \gamma_{jk} + \epsilon_{ijk} ~~~~~$$ where i=obs$$\in \{ 1,2,...,n \}$$, k=group$$\in \{ 1,2,3 \}$$

There are 8 columns in X.

a.2. Less Than Full Rank Model

$$Y_{ijk} = \beta_{0} + \beta_1group1_{i} + \beta_2group2_{i} + \beta_3group3_i + \beta_4group4_i + \beta_5time_i + \beta_6group1_i*time_i + \beta_7group2_i*time_i + \beta_8group3_i*time_i + \beta_9group4_i*time_i$$

$$Y_{ijk} = \mu + \alpha_{k} + \tau + \gamma_{jk} + \epsilon_{ijk} ~~~~~$$ where i=obs$$\in \{ 1,2,...,n \}$$, k=group$$\in \{ 1,2,3,4 \}$$

There are 10 columns in X.

b. If time points are unequally spaced, then would it be appropriate to treat time as a class variable?

Yes, that would be appropriate. There are other options to adjust for unequal time spacing, such as incorporating a SPACIAL POWER covariance structure, which just points out that there are certain considerations before choosing an approach over another. However, this adds more parameters to the model so one must make sure that the design allows this and/or that the study is powered enough to include these extra parameters.

# Question 12— [a and b only]

a.i. Write the LTFR model with 3 groups (2 subjects per group), 3 time points, and include a random intercept

$$Y_{ijk} = \mu + \alpha_{k} + \tau_j + \gamma_{jk} + b_i + \epsilon_{ijk} ~~~~~$$ where i=obs$$\in \{ 1,2,...,n \}$$, j=time$$\in \{ 1,2,3 \}$$, k=group$$\in \{ 1,2,3 \}$$

$$Y_{ijk} = \beta_{0} + \beta_1group1_{i} + \beta_2group2_{i} + \beta_3group3_i + \beta_4time1_{i} + \beta_5time2_{i} + \beta_6time3_{i} + \\ \qquad \beta_7group1_i*time1_i + \beta_8group1_i*time2_i + \beta_9group1_i*time3_i + \\ \qquad \beta_{10}group2_i*time1_i + \beta_{11}group2_i*time1_i + \beta_{12}group2_i*time1_i + \\ \qquad \beta_{13}group2_i*time1_i + \beta_{14}group2_i*time1_i + \beta_{15}group2_i*time1_i$$

There are 16 columns in X

X$$_{[18 \times 16]}$$ = $$\begin{bmatrix}$$ 1  ~ 1  0  0  ~ 1  0  0  ~ 1  0  0  ~ 0  0  0  ~ 0  0  0 \ 1  ~ 1  0  0  ~ 0  1  0  ~ 0  1  0  ~ 0  0  0  ~ 0  0  0 \ 1  ~ 1  0  0  ~ 0  0  1  ~ 0  0  1  ~ 0  0  0  ~ 0  0  0 \

1  ~ 1  0  0  ~ 1  0  0  ~ 1  0  0  ~ 0  0  0  ~ 0  0  0 \ 1  ~ 1  0  0  ~ 0  1  0  ~ 0  1  0  ~ 0  0  0  ~ 0  0  0 \ 1  ~ 1  0  0  ~ 0  0  1  ~ 0  0  1  ~ 0  0  0  ~ 0  0  0 \

1  ~ 0  1  0  ~ 1  0  0  ~ 0  0  0  ~ 1  0  0  ~ 0  0  0 \ 1  ~ 0  1  0  ~ 0  1  0  ~ 0  0  0  ~ 0  1  0  ~ 0  0  0 \ 1  ~ 0  1  0  ~ 0  0  1  ~ 0  0  0  ~ 0  0  1  ~ 0  0  0 \

1  ~ 0  1  0  ~ 1  0  0  ~ 0  0  0  ~ 1  0  0  ~ 0  0  0 \ 1  ~ 0  1  0  ~ 0  1  0  ~ 0  0  0  ~ 0  1  0  ~ 0  0  0 \ 1  ~ 0  1  0  ~ 0  0  1  ~ 0  0  0  ~ 0  0  1  ~ 0  0  0 \

1  ~ 0  0  1  ~ 1  0  0  ~ 0  0  0  ~ 0  0  0  ~ 1  0  0 \ 1  ~ 0  0  1  ~ 0  1  0  ~ 0  0  0  ~ 0  0  0  ~ 0  1  0 \ 1  ~ 0  0  1  ~ 0  0  1  ~ 0  0  0  ~ 0  0  0  ~ 0  0  1 \

1  ~ 0  0  1  ~ 1  0  0  ~ 0  0  0  ~ 0  0  0  ~ 1  0  0 \ 1  ~ 0  0  1  ~ 0  1  0  ~ 0  0  0  ~ 0  0  0  ~ 0  1  0 \ 1  ~ 0  0  1  ~ 0  0  1  ~ 0  0  0  ~ 0  0  0  ~ 0  0  1 $$\end{bmatrix}$$

a.ii. Write the FR model (SET-to-zero) with 3 groups (2 subjects per group), 3 time points, and include a random intercept

$$Y_{ijk} = \mu + \alpha_{k} + \tau_j + \gamma_{jk} + b_i + \epsilon_{ijk} ~~~~~$$ where i=obs$$\in \{ 1,2,...,n \}$$, j=time$$\in \{ 1,2,3 \}$$, k=group$$\in \{ 1,2,3 \}$$

$$Y_{ijk} = \beta_{0} + \beta_1group1_{i} + \beta_2group2_{i} + \beta_3time1_{i} + \beta_4time2_{i} + \\ \qquad \beta_5group1_i*time1_i + \beta_6group1_i*time2_i + \\ \qquad \beta_{7}group2_i*time1_i + \beta_{8}group2_i*time2_i + b_i + \epsilon_{ijk}$$

There are 9 columns in X

X$$_{[18 \times 9]}$$ = $\begin{bmatrix} 1 \ ~~~ 1 \ 0 \ \ ~~~ 1 \ 0 \ \ ~~~ 1 \ 0 \ \ ~ 0 \ 0 \ \ ~ \\ 1 \ ~~~ 1 \ 0 \ \ ~~~ 0 \ 1 \ \ ~~~ 0 \ 1 \ \ ~ 0 \ 0 \ \ ~ \\ 1 \ ~~~ 1 \ 0 \ \ ~~~ 0 \ 0 \ \ ~~~ 0 \ 0 \ \ ~ 0 \ 0 \ \ ~ \\ 1 \ ~~~ 1 \ 0 \ \ ~~~ 1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\ \ ~ 0 \ 0 \ \ ~ \\ 1 \ ~~~ 0 \ 0 \ \ ~~~ 0 \ 0 \ \ ~~~ 0 \ 0 \ \ ~ 0 \ 0 \ \ ~ \end{bmatrix}$

a.iii. Write the FR model (SUM-to-zero) with 3 groups (2 subjects per group), 3 time points, and include a random intercept

$$Y_{ijk} = \mu + \alpha_{k} + \tau_j + \gamma_{jk} + b_i + \epsilon_{ijk} ~~~~~$$ where i=obs$$\in \{ 1,2,...,n \}$$, j=time$$\in \{ 1,2,3 \}$$, k=group$$\in \{ 1,2,3 \}$$

$$Y_{ijk} = \beta_{0} + \beta_1group1_{i} + \beta_2group2_{i} + \beta_3time1_{i} + \beta_4time2_{i} + \\ \qquad \beta_5group1_i*time1_i + \beta_6group1_i*time2_i + \\ \qquad \beta_{7}group2_i*time1_i + \beta_{8}group2_i*time2_i + b_i + \epsilon_{ijk}$$

There are 9 columns in X

X$$_{[18 \times 9]}$$ = $\begin{bmatrix} 1 & ~~~ 1 & 0 & & ~~~ 1 & 0 & & ~~~ 1 & 0 & & ~ 0 & 0 & & ~ \\ 1 & ~~~ 1 & 0 & & ~~~ 0 & 1 & & ~~~ 0 & 1 & & ~ 0 & 0 & & ~ \\ 1 & ~~~ 1 & 0 & & ~~~ -1 & -1 & & ~~~ -1 & -1 & & ~ 0 & 0 & & ~ \\ \\ 1 & ~~~ 1 & 0 & & ~~~ 1 & 0 & & ~~~ 1 & 0 & & ~ 0 & 0 & & ~ \\ 1 & ~~~ 1 & 0 & & ~~~ 0 & 1 & & ~~~ 0 & 1 & & ~ 0 & 0 & & ~ \\ 1 & ~~~ 1 & 0 & & ~~~ -1 & -1 & & ~~~ -1 & -1 & & ~ 0 & 0 & & ~ \\ \\ 1 & ~~~ 0 & 1 & & ~~~ 1 & 0 & & ~~~ 0 & 0 & & ~ 1 & 0 & & ~ \\ 1 & ~~~ 0 & 1 & & ~~~ 0 & 1 & & ~~~ 0 & 0 & & ~ 0 & 1 & & ~ \\ 1 & ~~~ 0 & 1 & & ~~~ -1 & -1 & & ~~~ 0 & 0 & & ~ -1 & -1 & & ~ \\ \\ 1 & ~~~ 0 & 1 & & ~~~ 1 & 0 & & ~~~ 0 & 0 & & ~ 1 & 0 & & ~ \\ 1 & ~~~ 0 & 1 & & ~~~ 0 & 1 & & ~~~ 0 & 0 & & ~ 0 & 1 & & ~ \\ 1 & ~~~ 0 & 1 & & ~~~ -1 & -1 & & ~~~ 0 & 0 & & ~ -1 & -1 & & ~ \\ \\ 1 & ~~~ -1 & -1 & & ~~~ 1 & 0 & & ~~~ -1 & 0 & & ~ -1 & 0 & & ~ \\ 1 & ~~~ -1 & -1 & & ~~~ 0 & 1 & & ~~~ 0 & -1 & & ~ 0 & -1 & & ~ \\ 1 & ~~~ -1 & -1 & & ~~~ -1 & -1 & & ~~~ 1 & 1 & & ~ 1 & 1 & & ~ \\ \\ 1 & ~~~ -1 & -1 & & ~~~ 1 & 0 & & ~~~ -1 & 0 & & ~ -1 & 0 & & ~ \\ 1 & ~~~ -1 & -1 & & ~~~ 0 & 1 & & ~~~ 0 & -1 & & ~ 0 & -1 & & ~ \\ 1 & ~~~ -1 & -1 & & ~~~ -1 & -1 & & ~~~ 1 & 1 & & ~ 1 & 1 & & ~ \end{bmatrix}$

b.

## References

NOAA National Centers for Environmental information, Climate at a Glance: Global Time Series, published August 2018, retrieved on September 5, 2018 from https://www.ncdc.noaa.gov/cag/global/time-series