This may be a feature request rather than a question. I am teaching a quantitative research methods class where the students use either Stata or RStudio. In the computer labs we work on a data analysis problem together. At the end of the class, the students have an analysis file which they use to produce a notebook in Word format. Then they have one week to go through the notebook and write an explanation for each step of the analysis and their interpretation of the results.
Producing a notebook is something that is simple with RStudio, but requires a lot of manual work in Stata. After preparing the analysis file, the RStudio users simply use the RStudio's compile notebook feature. It runs the analysis file and produces one notebook file (PDF, HTML, or Word format) containing the R code and all the output including all plots.
To give an example, the student starts with an analysis file that may look like this
https://www.dropbox.com/s/0vcqu331xa...ise%201.R?dl=1
Then they use the compile notebook feature of RStudio to produce a notebook that looks like this
https://www.dropbox.com/s/jpuunw5z57...raw-R.doc?dl=1
The students then write explanation for each step of the analysis and interpret the results. You can check my model answer here
https://www.dropbox.com/s/w71kqgtfb5...%20R.docx?dl=1
If anyone knows anything similar for Stata, I would be very interested. I know that graphlog package produces PDF logs containing all plots, but I need the logs/notebooks in a format that the students can easily edit. Moreover, I would prefer that the students do not have to user graph export for each plot that they do. To obtain similar output using Stata, I currently suggest the following workflow:
- Set your working directory
- Start your do file with "log using assingment1, replace text"
- End your do file with "log close"
- After each graph add "graph export plotX.pdf"
- Open the Word document template from MyCourses
- Copy-paste the content of assignment1.log to the document template and insert the exported figures into right places.
If there are multiple figures, then preparing the document manually takes time. Here is the output that I would like to get (my model answer):
https://www.dropbox.com/s/8kahu9565t...tata.docx?dl=0
Mikko
Producing a notebook is something that is simple with RStudio, but requires a lot of manual work in Stata. After preparing the analysis file, the RStudio users simply use the RStudio's compile notebook feature. It runs the analysis file and produces one notebook file (PDF, HTML, or Word format) containing the R code and all the output including all plots.
To give an example, the student starts with an analysis file that may look like this
https://www.dropbox.com/s/0vcqu331xa...ise%201.R?dl=1
Then they use the compile notebook feature of RStudio to produce a notebook that looks like this
https://www.dropbox.com/s/jpuunw5z57...raw-R.doc?dl=1
The students then write explanation for each step of the analysis and interpret the results. You can check my model answer here
https://www.dropbox.com/s/w71kqgtfb5...%20R.docx?dl=1
If anyone knows anything similar for Stata, I would be very interested. I know that graphlog package produces PDF logs containing all plots, but I need the logs/notebooks in a format that the students can easily edit. Moreover, I would prefer that the students do not have to user graph export for each plot that they do. To obtain similar output using Stata, I currently suggest the following workflow:
- Set your working directory
- Start your do file with "log using assingment1, replace text"
- End your do file with "log close"
- After each graph add "graph export plotX.pdf"
- Open the Word document template from MyCourses
- Copy-paste the content of assignment1.log to the document template and insert the exported figures into right places.
If there are multiple figures, then preparing the document manually takes time. Here is the output that I would like to get (my model answer):
https://www.dropbox.com/s/8kahu9565t...tata.docx?dl=0
Mikko
Comment