Description Usage Arguments Details Value
This function can be used to generate the input parameters for the ensemble imputation code. This is a good way to get a list of the required parameters and then modify parameters to match your particular configuration.
1 | defaultImputationParameters(variable = NULL)
|
variable |
Should be one of "production", "yield", "seed", or the numeric element code. These are currently the three variables for which this imputation package has been used. You may also set this to NULL and then manually assign values to the variable, imputationValueColumn, imputationFlagColumn, and imputationMethodColumn elements of this list. |
Below is a description of the parameters:
yearValue: The column name for the year variable in data.
byKey: The column name for the variable representing the splitting group. Usually, this is the country variable.
ensembleModels: A list of objects, all of type ensembleModel, which will be applied to the data.
restrictWeights: Should the maximum weight of one model in the ensemble be restricted?
maximumWeights: If restrictWeights == TRUE, then this value (between 0.5 and 1) gives the largest value of a weight for a particular ensemble.
plotImputation: Should the results of the imputation be plotted? If no, this argument should be "". Otherwise, the value is passed to plotEnsemble as the returnFormat, see ?plotEnsemble. The allowable values are "" (the default) "faceted" or "prompt". "faceted" will return one plot while "prompt" will cycle through all byKey groups of plots.
errorType: Should "raw" errors be used or "loocv" (leave-one-out cross-validation)? In general, "loocv" should be preferred, but "raw" is faster.
errorFunction: A custom error function may be specified. The default is mean-squared error. This should be a function of a single vector numeric argument, and the return value should be a numeric vector of length 1.
groupCount: How many cross-validation groups should be used for the ensemble models?
missingFlag: How are missing values specified in the database? Usually, this is "M".
imputationFlag: What observation flag should be assigned to imputed values?
newMethodFlag: What method flag should be assigned to imputed values?
flagTable: A table of the observation flags and their corresponding weights.
variable: The name of the variable being imputed, either "seed", "yield", or "production".
imputationValueColumn: The column name of the value to be imputed.
imputationFlagColumn: The column name of the observation flag for the imputed variable.
imputationMethodColumn: The column name of the method flag for the imputed variable.
newImputationColumn: The column name of a new column to append to the dataset which will store the imputed values. The data will be contained in a column with the Value_ prefix appended to this name, and the flags will prepend "flagObservationStatus_" and "flagMethod_". If this parameter is "", the original data columns are overwritten with the imputed data.
estimateNoData: This logical value indicates if imputation should be performed for countries with no available observations. For example, a hierarchical regression model may be fit to the data via defaultMixedModel (with an updated formula) or something similar. Then, this model could be used to estimate for countries with no available data provided that data is available for some higher hierarchy. The default, though, is FALSE: one must set this option if it is desired to be used.
Returns a list of the default parameters used in the ensemble imputation algorithms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.