Covariates are continuous variables containing information about all quantities other than size and shape of the landmark configurations under study. For instance, covariates might be used to specify the location (latitude, longitude and altitude) where specimens were collected, the age or body weight of individuals, percentages of food categories in the diet, physiological measurements, etc.
Normally, covariatets are imported from text files produced by spreadsheet or database programs. Usually, this kind of program is also the best means to make changes to covariates. MorphoJ offers some possibilities for making changes to individual values, for adding new covariates, for changing all occurrences of certain values (e.g. to adjust the format for missing values), and for deleting covariates (if you decide to import fresh copies from a text file). It is also possible to copy and paste to and from MS Excel spreadsheets (and similar programs).
To start editing covariates, select the dataset by clicking on its icon in the Project Tree window, and then select Edit Covariates from the Preliminaries menu. A user interface like the following will appear:
Most of the user interface is taken up by a spreadsheet-style table that shows the covariates in its columns and the observations as rows. The table can be used for inspecting and editing individual values of the classifier variables.
Missing values are shown in the table as "NaN" ('not a number').
Below the table are several other controls for selecting and manipulating classifier variables. Several tasks can be performed that will either change the values of the classifier variables or the variables themselves.
All the manipulations of the table are carried out on a copy of the covariates in the dataset. By clicking Cancel, the procedure can be aborted and the dataset thus keeps its previous state. By clicking Accept, all the changes made are transferred to the dataset and made permanent. Moreover, other analyses or datasets that depend on the modified covariates are updated to reflect the changes. In particular, if covariates are deleted from the dataset, some other analyses and relevant datasets that relate to these classifiers may need to be deleted (in this case, a warning is given to the user before the classifiers are deleted from the copy).
Individual values of covariates can be edited by double-clicking on the respective cell of the table. This opens the cell in editing mode, and a new value can be entered. If an invalid entry is made (e.g. a word), the original value of the cell is retained.
To specify a missing value, enter "." or "NaN" (the Java code for 'not a number'). This will be interpreted as a missing value and, depending on the type of analysis in which the covariate will be used, the corresponding observation may be excluded (e.g. for regression and partial least squares analyses).
It is possible to copy and the paste values of single cells or rectangular blocks of cells. To copy values, select the block of cells and use the key combination Control-C. For pasting, select the cell in the upper-left corner of the block of cells, and use the key combinaton Control-V.
To select ranges of cells for copying and pasting, these must be selected in the body of the table itself. Selecting columns by clicking on the table's header bar or by selecting covariates in the list in the lower-left part of the interface will yield copies of the covariates' names, not the values for the observations.
For changing entire series of values of a covariate, select the variable by clicking on its name in the header bar of the table or in the list of classifiers at the lower-left corner of the interface. Then click on the Replace values button. A dialog box like the following will appear:
The two drop-down menus are for selecting the value to be replaced (upper menu) and the value to be inserted instead (lower menu). For the latter, it is also possible to type in a new value.
To replace single occurrences of a value, use the Find Next and Replace buttons to navigate to an appropriate occurrence and to make the replacement. (After using the Replace button, the selection does not automatically advance to the next occurrence, so that the user can check the effect of the change.)
Alternatively, use Replace All to replace all occurrences of a given value. For instance, to replace all missing values by 0.0, you would select "NaN" from the upper menu and type "0" into the text field of the lower menu, and then click on Replace All.
Clicking the Done button closes the dialog box.
To change the name of a covariate, first select its current name in the header bar of the table or in the list in the lower-left part of the user interface. The name of the variable will then also appear in the text field in the lower-right part of the user interface, where the user can replace it with a new name. Clicking the Rename covariate button will then make the name change.
To add a new covariate, click the Add covariate button. The following dialog box will then appear:
Enter a name for the new covariate and click OK to create the new variable. It is added at the end of the list of variables. All values of the new covariate are initially set to 0.0, but they can be changed by the methods outlined above.
If the values for the new covariate already exist in an external program (e.g. spreadsheet, data base), it is probably easier to import the covariate from a text file.
To delete one or more covariates, select the names of the variables and click Delete covariate(s).
If none of the selected covariates is in use by an analysis in the project, the variable or variables will be deleted. Note that this cannot be undone, but clicking Cancel will prevent the deletion from becoming permanent (but will also discard any other changes made to the classifiers).
If one or more of the covariates are used by analyses in the project, a dialog box like the following will appear:
The warning in this dialog box indicates that a partial least squares analysis named "PLS covariates" and the dataset "PLS covariates scores" containing the resulting PLS scores are affected, because the PLS analysis is using the covariate that was chosen for deletion. If the covariate is deleted, the analysis and the dataset with the PLS scores will also be deleted.
If the user clicks OK, the covariate will be deleted along with any analyses and datasets that depend on it. Clicking Cancel aborts the process.
Any deletions, both of the covariates and of the analyses or datasets that depend on them, can still be discarded by aborting the process of editing classifiers (click the Cancel button in the user interface for editing covariates). All these changes are only made irreversible when the Accept button is clicked.