asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › asdocx to export codebook from Stata to Excle | Word
Eric MelseParticipantFebruary 3, 2021 at 7:43 pmPost count: 7
Your web page:
is most helpful and I am using asdocx for this purpose now.
I do run into some issues:
1. String fields are problematic?
It seems that string fields cannot be included which makes sense if the algorithm expects fields that need to be summarized.
Try the attached dta file with this command:
use "Example_asdocx_Codebook_text_fields_error.dta" , clear asdocx codebook, save(MyFile.xlsx) replace
When you delete the variable Q4_99999996t, then will run asdocx codebook correctly.
It is maybe complicated to code, but what I think would be very useful is to include the following information of string fields:
Var Label name type (count?)
I mean, that is necessary to document in a codebook.
2. asdocx result – file type
Note that on your web page you provide the examples:
* Load the working women dataset sysuse nlsw88, clear * Send a compact codebook to MS Word asdocx codebook, replace * Send a compact codebook to MS Excel asdocx codebook, save(Myfile.xlsx) replace * But, should you run these lines, commands, and next run this again: * Send a compact codebook to MS Word asdocx codebook, replace
Then the output file is an Excel file and not a Word file.
Conclusion, asdocx uses Word as the default result – file type, if the type is not set, but continues using the result – file type once that is set before (when it is not set differently).
I suppose that could be confusing to the user.
Either you could have asdocx always ask for result – file type, or have it always default result – file type to Word when not set to Excel.
I will write you again about the Performance of the codebook functionality when I have done more testing.
I have a survey file with about 70.000 observations and about 1.200 variables.
It takes ages to run codebook so I decided to ‘drop’ all observations and create 1 empty observation, meaning that no statistics get reported.
In this case I need the variable names and labels, so that is fine.
But, I will also need to create codebooks that include the statistics and I have also much larger surveys.
So, performance is an issue (yes, I will invest in a faster computer too!).
4. Codebook options
My suggestion is to include options to ‘enable/disable’ the inclusion of statistics, which would also result in different table formats (including/excluding columns).
The advantage would be to make the column of the variable label more wide.
* Send a compact codebook to MS Excel with only the variable labels and names: asdocx codebook , stats(label name) save(Myfile.xlsx) replace * Same result with different order: asdocx codebook , stats(name label) save(Myfile.xlsx) replace * Send the full codebook to MS Excel: asdocx codebook , stats(label name uniq count mean min max) save(Myfile.xlsx) replace * Send a compact codebook to MS Excel with only the variable names and some selected statistics: asdocx codebook , stats(name uniq count mean) save(Myfile.xlsx) replace
Other statistics, of course I am ‘hungry’ for statistics to include, certainly using Excel (or Word in Landscape orientation! Which would be another new option: page(portrait/landscape)) gives ample room to include:
E.g. all the
r()after sum xxx,
makes sense to include as a codebook option for statistics.
Eric MelseDr. Attaullah ShahKeymasterFebruary 3, 2021 at 7:58 pmPost count: 106
Hello Professor Melse
Thanks for the detailed feedback.
I have modified asdocx in light of your suggestion and now it works with string variables as well.
I have discussed the permanent and session settings on this https://asdocx.com/asdocx-documentation/session-and-permanent-options-asdocx/ page. The idea is that once a session variable is set, it remains the same for user’s convenience. So, if one changes
save()options, they remain the same unless changed again. This saves the user’s time and efforts in not having to type them over and again.
I have improved the speed by using an alternative algorithm for finding the required statistics.
This will take some time as I have to work more on adding these statistics.
You can update and test the new version
- You must be logged in to reply to this topic.