• No se han encontrado resultados

Merging BSD with ARDx created many not available values within the datasets as presented in the Results Chapter (Section 7.1) as some smaller firms were not included in the scope of ARDx each year. To estimate values for missing years, multiple methods were available, such as EMB algorithm or predictive mean matching method. Secure Lab did limit the capacity to compute NAs with the most sophisticated methods. Therefore, rather than focusing on methods, this chapter will consider packages available in R to implement these methods, so that the most appropriate approach could be selected.

The bootstrapped predictive mean matching approach was used for both Wooldridge’s TFP and dynamic TFP estimation and Cox Regression, but simpler time series imputation was employed for the unbiased REEM and survival trees. It is worth acknowledging that the automated imputation was attempted to be kept to a minimum and applied only to variables that were unlikely to be very important. The key variables on firm characteristics (location, size with regards to employment and turnover) from BSD and SBRR were not imputed in this manner.

6.2.2.5.1 Basics of Imputation

The methodology depends on the missing data mechanism. There are three types of mechanisms: missing completely at random (MCAR), missing at random (MAR), and not missing at random (NMAR). ARDx sampling procedure discussed in Section 6.2.1.1 implies that the data should follow MAR mechanisms. One-stage stratified or systematic random sampling was used for all large businesses surveyed, whilst a subset of medium and small businesses sampled. In other words, selecting all the largest businesses each year with a progressively reducing fraction of smaller businesses.

Another assumption to make when imputing data is its distribution. Some techniques (parametric) require to define the distribution (usually normal distribution) before the analysis; other techniques may not have this limiting assumption about the distribution and they are classed as non-parametric. For methods that use linear regression, dependencies are assumed to follow a linear pattern. Rubin (1987) proposes how to impute values with MAR patterns:

• Use many variables, including dependent and any other variables that may help to explain the values

• Create several imputed datasets

• Run analysis on several imputed datasets

146

This thesis used Rubin’s (1987) advice when coefficients were found inconsistent during dynamic productivity estimation discussed in Section 6.3.1.4. The approach was to firstly estimate a thousand samples by imputation and then perform the estimation with all thousand samples. Finally, the coefficients and standard errors were averaged to find the final estimates. This was believed to reduce the measurement error significantly.

6.2.2.5.2 Imputation in R with Advanced Methods

It was challenging to identify an appropriate MAR imputation technique. Moritz et al. (2015) acknowledged several different methods of data imputation in R. They classified these into imputation based on random forests (missForest), maximum likelihood estimation (mvnmle), expectation maximization (mtsdi), nearest neighbourhood observation (yaImpute), predictive mean matching (BaBooN), conditional copula specifications (CoImp), and finally the sophisticated multiple imputation methods with such packages as MICE, missForest, Hmisc and mi. These were preferable for this analysis and are discussed in further detail in the following paragraphs.

One of the most popular methods is Buuren and Groothuis-Oudshoorn’s (2011) Multivariate Imputation via Chained Equations (MICE). MICE generates multiple imputations. As the authors define, it ”imputes an incomplete column (the target column) by generating ’plausible’ synthetic values given other columns in the data.” It individually processes each column, predicting it from all the others and, in hand, reducing uncertainty in missing values. Suppose one has variables:x1, x2, x3, …, xk. If x1 has NA values, then it will

be regressed on other variables x2 to xk. The missing values in x1 will be then replaced by

predictive values obtained. Therefore, it does not assume normal distribution like Amelia but rather can include multiple types of variables. More specifically, numerical variables are estimated with predictive mean matching, binary variables with logistic regression, factor variables with Bayesian polytomous regression and ordered with the proportional odds model. In practice, the method may be difficult to implement because it does require the inclusion of all variables likely to impact the variables being imputed. It does assume the probability that a value is missing depends only on observed value and can be predicted using them. Unfortunately, this approach was too data intensive for the capacity within the ONS Secure Lab.

A slightly different methodology was adopted. The package, mi, or multiple imputations with diagnostics builds numerous imputation models to predict NA values by using the predictive mean matching approach. For each observation in a variable with NA value, an observation with the closest predictive mean to that variable is found. The observed value from this “match” is then used as the imputed value. A more advanced

147

package using a similar technique is Hmisc. It has two functions, impute and aregImpute. The former imputes values using a simple statistical method such as mean, max, median or mean. Whereas aregImpute() uses bootstrapping to additive regression and predictive mean matching to impute values. In Frank H. E.’s (2013) words

“[the] R package version 3.6-3. ‘aregImpute’ takes all aspects of uncertainty in the imputations into account by using the bootstrap to approximate the process of drawing predicted values from a full Bayesian predictive distribution. Different bootstrap resamples are used for each of the multiple imputations, i.e., for the ‘i’th imputation of a sometimes missing variable, ‘i=1,2,... n.impute’, a flexible additive model is fitted on a sample with replacement from the original data and this model is used to predict all of the original missing and non-missing values for the target variable.”

Given the discussion above, the mice and aregImpute functions are compared. The data was divided into 75% and 25%. For the group with 75% of data, values were imputed and compared the accuracy with real values for the 25% of data. AregImpute provided 15% more accurate estimates than the MICE package and, as a result, was a preferable approach for imputation. As a result, this imputation approach was used to estimate missing values for matching purposes. To accommodate time and enterprises identifiers, some variations were exploited within the imputation formula. Firstly, imputation was run by looping through separate enterprises and including all variables discussed in Section 6.2.2.4. However, it seemed reasonable that changes in inputs and outputs of other firms may help to predict the missing values. Thus, the imputation was performed on all cleaned data but only with the inclusion of variables that were likely to have an impact on the missing values. The key variables, following ONS suggestions, were taken from BSD. They had sufficient coverage and were likely to be precise predictors: turnover, employment, region, sector, legal status. A separate function was run for each variable that has NAs.

Without bootstrapping, this method seemed to be inappropriate to be used after matching since estimated variables essentially included some effects from the other covariates. More specifically, those imputed values were likely to account for some of the variances in the more causality based approaches discussed in Section 6.3. Thus, by not estimating multiple samples, the serial correlation could not be controlled. Instead, Steffen Moritz’s (2016) more simplistic imputeTS package was used as this is especially designed for univariate time series imputation. It offers several different algorithm implementations depending on several distances: linear, spline, stineman or kalman. To isolate firms, the imputation was run separately for each firm. All methods (linear, spline, stineman or kalman) provided very similar imputations. The fastest to impute these large datasets was

148

with automated imputation, which is the reasoning for its use for tree estimation. The bootstrapping for the trees with longitudinal data was not performed since the new approaches were not equipped to use bootstrapping. Nevertheless, the bootstrapped multiple imputations was employed with all other methods (Wooldridge's TFP estimation, dynamic TFP estimation, Cox Regression).

Documento similar