Hi,
I have a two-variable one-observation dataset in Excel. Variable 1 is 1.26684846 * (10^-9)and Variable 2 is 266555659858927. Both are, respectively, just arbitrarily small and large numbers I chose to show my point. Further, in Excel, both values are stored using the "Number" format, meaning they are displayed not in scientific notation but in full precision if the right number of decimals is set. If I use -import excel- to import said dataset to Stata, I will get the data both displayed and stored in scientific notation. Although the first variable (the small one) is stored at full precision, the latter does lose some information. I am puzzled by this information loss.
I have tried to emphasize precision in the command statement, but to my knowledge, -import excel- does not have any option (at least, none shown in the helpfile) that allows the user to change the default storage type, as does -insheet- with option -double-, although this option does not help in the loss of precision for large numbers. Thus, it seems that there is no way to increase precision for large values, although -insheet ...,double- does offer such precision increase for small values (at least until the max precision of the double storage type is met).
What prevents Stata from importing very large values from Excel at *full* precision? Is there any way to do so when using -insheet- or -import excel-? I haven't been able to find an answer to this problem in earlier posts. I did, however, find a reference to -xmluse-, but it seems that saving Excel data in .xml format is not as straightforward as it sounds. Also, I understand it is rarely useful to demand much precision at very large values, but still is a question worth asking.
Thanks in advance,
José
I have a two-variable one-observation dataset in Excel. Variable 1 is 1.26684846 * (10^-9)and Variable 2 is 266555659858927. Both are, respectively, just arbitrarily small and large numbers I chose to show my point. Further, in Excel, both values are stored using the "Number" format, meaning they are displayed not in scientific notation but in full precision if the right number of decimals is set. If I use -import excel- to import said dataset to Stata, I will get the data both displayed and stored in scientific notation. Although the first variable (the small one) is stored at full precision, the latter does lose some information. I am puzzled by this information loss.
I have tried to emphasize precision in the command statement, but to my knowledge, -import excel- does not have any option (at least, none shown in the helpfile) that allows the user to change the default storage type, as does -insheet- with option -double-, although this option does not help in the loss of precision for large numbers. Thus, it seems that there is no way to increase precision for large values, although -insheet ...,double- does offer such precision increase for small values (at least until the max precision of the double storage type is met).
What prevents Stata from importing very large values from Excel at *full* precision? Is there any way to do so when using -insheet- or -import excel-? I haven't been able to find an answer to this problem in earlier posts. I did, however, find a reference to -xmluse-, but it seems that saving Excel data in .xml format is not as straightforward as it sounds. Also, I understand it is rarely useful to demand much precision at very large values, but still is a question worth asking.
Thanks in advance,
José
Comment