In this paper, the estimation of production functions and measurement of the rate of technical change is performed when selectivity bias is expected, A sample selection model consisting of a selection and a regression equation is estimated using Heckman's two-stage method. It is discussed in the context of a production function where the underlying technology is represented by a translog functional form. For the regression, a random effects model with heteroscedastic variances is assumed. This model and an alternative conventional model retaining heteroscedasticity without considering selectivity bias are estimated using the Generalized Least Squares method. The data used are a large rotating panel data set from Swedish crop producers over the period 1976-1988. The empirical results from the comparison between these two models show that the introduction of heteroscedasticity and the integration of sample selection in the production relationship is important. The impact of a correction for selectivity bias on the results, in terms of input elasticities and returns to scale is found to be significant.