I'm new with STATA, and i'm trying to perform an append of different datasets and there is a specific variable for which i'm having problems to append correctly. In the original dataset this variable is double and in the last dataset to append imported to stata (from a csv file) this variable was imported as string. The variable refer to the income for individuals for a specific month. While trying to run this command and force it to do it, STATA reclassify the value to another ones. To solve this i try:
1. destring the variable (before the append) --> not worked since the output is an error for non numeric values
2. encode and recast --> this don't bring any error
However when finally append the datasets with this last variable converted (from "2.") the result is the same one as the beginning. STATA assign new values for each observation.
The dataex after the appending (listed in 1/15):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double P21 2 2 2 2 2 1 2 98 2 2 1 2 376 278 2 end label values P21 P21_NN label def P21_NN 1 "-9", modify label def P21_NN 2 "0", modify label def P21_NN 98 "16,000", modify label def P21_NN 278 "40,000", modify label def P21_NN 376 "8,000", modify
Many thanks!
Bruno
0 Response to Problem for append datasets
Post a Comment