Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: xml_tab, then xmluse, not working


From   Hewan Belay <hewan_belay@yahoo.com>
To   Stata List <statalist@hsphsun2.harvard.edu>
Subject   st: xml_tab, then xmluse, not working
Date   Tue, 28 Aug 2012 01:49:29 -0700 (PDT)

Dear statalist,
 
I am trying to save estimates produced from various regressions, send them into a spreadsheet, then bring back the estimates into stata so that i can easily organise them in a way that I can then directly use as a table presenting results. However, the procedure I am using is not working, though as per my reading of the commands, it should. What I do is this: 
 
1) I first save the estimates using -estimates store-
2) Then I send them to a spreadsheet using -xml_tab-
3) Finally, I try to bring the estimates themselves into a stata "data"set using -xmluse-
 
Here is a toy example, using the auto data, of what I am trying to achieve, where it can be easily replicated to see that it's not working for reasons unknown to me:
 
webuse auto
reg price mpg 
est store toyreg1
reg price rep78 headroom trunk 
est store toyreg2
reg price weight length turn 
est store toyreg3
reg price displacement gear_ratio foreign
est store toyreg4
xml_tab toyreg1 toyreg2 toyreg3 toyreg4, save("D:/toyreg_table") replace   
xmluse "D:/toyreg_table", doctype(excel) clear
 
All goes well until and including the xml_tab line. After that line, I can also verify that the xml file is in fact in my D:/ folder and can be opened. When I run the last line however, I get the error message "unrecognizable XML doctype". I tried using -doctype(dta)- instead, as well as no -doctype()- option; in both cases, the same error message appears. I also added the extension .xml, i.e. 
 
xmluse "D:/toyreg_table.xml", doctype(excel) clear
 
and did that again with all three options concerning -doctype()-. Again, in all of these three cases, same error message.
 
xmluse is supposed to be able to call up an xml file into stata... why is it not doing so??
 
Thank you in advance for any advice.
Hewan

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index