Using a regression coefficient as independent variable Two continuous variables, $Z$ and $X$, are measured at 60 time points during a week for a given person. At the end of the week, the persons value of a variable $Y$ is measured. This is repeated during six consecutive weeks. For each weeks data the regression coefficient $\beta_1$ is estimated in linear model
$$Z = \beta_0 + \beta_1X + \epsilon$$
At the end of the six weeks, for a given observed person there are six $\beta_1$ values and six $Y$ values. There are about 100 persons in the study. The final goal is to investigate how $\beta_1$ influences the dependent variable $Y$ in regression model:
$$Y = b_0 + b_1\beta_1 + \varepsilon$$
In this final equation the independent variable is $\beta_1$, which is an estimate based on 60 observations and this causes a problem, because $\beta_1$ has, say, "measurement error". What kind of model could I use to deal with this problem?
 A: Assuming $i$ indexes individuals, and $t$ indexes times of measures within individuals:
$$\begin{align*}Y_{ti} & = \beta_{0,ti} + \beta_{1,t}X_{ti} + \epsilon_{0,ti} + \epsilon_{1,ti}X_{ti} + \mu_{0,i}\\\\
\text{where, for example}\\\\
\left[\begin{array}$\epsilon_{0}\\\epsilon_{1}\end{array}\right]&\sim \Omega\left[0,\begin{array}{llr}\sigma^2_{\epsilon0}\\\sigma_{\epsilon 01} & \sigma^{2}_{\epsilon2}\end{array}\right]\text{, and }\sigma^2_{\mu}\sim \mathcal{N}(0,\sigma^{2}_{\mu})\end{align*}$$
You will also need to make choices about how you want to estimate the variance/covariance matrix for $\epsilon_{0,ti}$ and $\epsilon_{1,ti}X_{ti}$ (e.g., constrain covariance $\sigma_{\epsilon 01}$ to zero and assume independent variances $\sigma^2_{\epsilon 0}$ & $\sigma^2_{\epsilon 1}$, constrain covariance to zero and assume equal variances, estimate covariance without constraints, etc.). MLwiN can estimate this kind of model using IGLS or a Bayesian MCMC model (as can BUGS, JAGS, etc. for the latter).
The term $\beta_{1,ti}$ estimates the average effect of $X$ on $Y$ across all times.
The terms $\sigma^2_{\epsilon 1}$, and if constrained or estimated to be zero, the terms $\sigma^2_{\epsilon 0}$ and $\sigma_{\epsilon 01}$ are combined in a quadratic function of $X_{ti}$ to model variation in $\beta_1$ across values of $X_{ti}$ (i.e. this is a model of complex variance of the effect of $X$ give your repeated measures structure).
My answer is making assumptions about the sufficiency of your sample size, the particulars of your study design (e.g., does $t=1$ or $t=24$ mean the same thing for all individuals?), normal or multivariate normal errors, etc.
