Can I use calculated data for regression Can I use calculated data for regression analysis.

case 1: first run OLS $y = \alpha+\beta x$, and get $\hat\beta$, then calculate $z = h^\hat\beta$, at last run $m = \gamma + \mu z$.

case 2: follow the same settings as case 1, run $z = \zeta + \rho p$.

case 3: use matlab solve equation $k_i = \sum_j d_{ij} k_j$ for $k_i$, then run $w = \theta + \pi k$.

where $\alpha$,$\beta$,$\gamma$,$\mu$,$\zeta$,$\rho$,$\theta$,and $\pi$are coefficients, the other letters denote the variables.I have the variables y,x,h,m,p,$d_{ij}$,w. All the relationships between variables are from the models.

They are independent cases that I ran into.

I am going to estimate the coefficients $\mu$,$\rho$,and $\pi$.
I'm afraid the accepted answer is not precise enough, and can be deeply misleading. 

This issue is formally called the Generated Regression problem which arises when we use "generated" regressors in a regression. This is a very common feature of estimations like Heckman Selection Model, where we use the predicted Inverse Mills Ratio from the selection equation in the structural equation. We need to divide the issue in two:


Consistency: there is usually no problem of consistency when using generated regressors in an estimation. A formal proof can be found in Wooldridge (2010), page 123.  
Statistical inference: here there might be problems. Under the null that generated regressors are zero, then standard errors and all tests are valid (you might still need to correct for heteroscedasticity and serial correlation as usual, using robust standard errors). However, if the generated regressor is statistically significant, then the standard errors and in consequence any test are invalid. What you need is a correct estimation of the asymptotic variance. The formulas depend on each case (more information in Newey and McFadden [1994]). However, a general solution to calculate the consistent standard errors is to use bootstrapping. As an aside, for example, if you use Stata, just run your normal command with the following code before:

bootstrap, reps(400) seed(10101): regres ...



reps is the number of repetitions and seed is for reproducibility. 

TL;DR

If your generated regressor is statistically significant in your regression, then you need to estimate the standard errors using boostrapping because they are invalid. If they are insignificant, you are safe.