Below is a list of readreplace
tests. Unless marked otherwise, all tests are implemented in the cscript. Each test is associated with a unique positive integer ID.
Contributions of new tests are welcome. When adding a test to the cscript, please add a row to the table below. All datasets should be readable by Stata 10, the minimal supported version.
Test ID | Area | Description |
---|---|---|
1 | Basic | Help file example for readreplace version 1 |
2 | User mistakes | Specify .csv files that result in an insheet error. |
3 | User mistakes | Specify a .csv file whose first column is not the ID variable. |
4 | User mistakes | Specify .csv files that do not contain exactly three columns. |
5 | Basic | Specify deprecated option display ; it should have no effect. |
6 | User mistakes | The variable name variable contains a value that is not an unabbreviated variable name. |
7 | User mistakes | Specify a replacements file with ID values not in the dataset in memory. |
8 | Basic | Specify a replacements file with no observations. |
9 | Basic | Specify a string ID variable and a replacements file to insheet that has no observations. |
10 | Basic | Specify a replacements file whose variable name variable includes both numeric and string variables. |
11 | User mistakes | Specify a replacements file whose variable name variable is numeric. |
12 | Basic | Specify a replacements file whose variable name variable includes a string variable but whose new value variable is numeric. |
13 | Basic | Specify a replacements file whose variable name variable includes a numeric variable but whose new value variable is string. Further, while all the values for numeric variables are numeric when converted by Mata's strtoreal() , some contain leading and trailing spaces. |
14 | User mistakes | Specify a replacements file whose variable name variable includes a numeric variable but whose new value variable specifies a string value for that variable. Blank values ("" ) are interpreted as string, and are not converted to sysmiss . |
15 | User mistakes | Specify option variable() without option value() , and vice versa. |
16 | User mistakes | Specify nonexistent variables to options id() , variable() , and value() . |
17 | User mistakes | Specify the same variable to options variable() and value() . |
18 | User mistakes | Specify the same variable to options id() and variable() and to id() and value() . |
19 | Basic | Simple tests of options use , insheet , excel , and import() . |
20 | User mistakes | Specify multiple import command options. |
21 | User mistakes | When the ID variable has different names in the dataset in memory and the replacements file, specify a varlist to option id() that matches both names. |
22 | Basic | Simple tests of ID varlists |
23 | User mistakes | Specify a replacements file whose variable name variable contains an ID variable. |
24 | User mistakes | Specify a varlist to option id() while using version 1 syntax. |
25 | Basic | The dataset in memory has no observations; specify replacements files with and without observations. |
26 | Basic | Simple tests of numeric recasting |
27 | Basic | Simple tests of string recasting |
28 | Basic | Help file examples for readreplace version 2.0.0 |