This paper proposes a random coefficient panel model where the regressors are correlated with the time-varying random coefficients in each period, a critical feature in many economic applications. We model the random coefficients as unknown functions of a fixed effect of arbitrary dimensions, a time-varying random shock that affects the choice of regressors, and an exogenous idiosyncratic shock. A sufficiency argument is used to control for the fixed effect, which enables one to construct a feasible control function for the random shock and subsequently identify the moments of the random coefficients. We propose a three-step series estimator and prove an asymptotic normality result. Simulation results show that the method can accurately estimate both the mean and the dispersion of the random coefficients. As an application, we estimate the average output elasticities for a sample of Chinese manufacturing firms.