-
Notifications
You must be signed in to change notification settings - Fork 18
Course utilities
The SRQM course relies on the profile.do
file located at the root of the SRQM
folder. This do-file relies, in turn, on a set of ado-files located in the setup
folder.
List of 'core' utilities, used to set up Stata for taking the course:
-
srqm
: check the integrity of the course utilities -
srqm_grab
: add files to the course material by copying them from a remote source -
srqm_link
: link to theSRQM
folder from the Stata application folder -
srqm_pkgs
: install Stata packages used in the course -
srqm_scan
: check the integrity of the course material (data and code)
List of additional utilities, used for testing the course material:
And last, some shorter utilities are grouped in the utils.ado
file.
All commands above should be run from the SRQM
folder.
In Stata, use which
to get short descriptions of each utility. Alternatively, type srqm, v
or srqm, verbose
to get a complete description of the utilities located in the setup
folder.
When students type run profile
after setting the working directory to the SRQM
folder, the profile.do
file located in the SRQM
folder will do the following:
- Set global variables (macros), including
$SRQM_WD
(working directory) - Open a 'course log' at
srqm.log
- Configure Stata – set
memory
(Stata < 12),maxvars
,more
, etc. - Check the integrity of the
setup/
,code/
anddata/
course folders
- done by the
srqm_scan
utility - includes routines to try recovering missing data files
- if that fails, stop
- Link to the
SRQM
folder from the Stata application folder
- done by the
srqm_link
utility
- Check that all course-required packages are installed
- done by the
srqm_pkgs
utility - some installed packages are not (yet) used in the course
srqm_datamake.ado
+srqm_datatrim.ado
)- if fail, stop
Experimental. Produces categorical plots that use colored gradients to draw the bars. Relies on Nick Cox's catplot
command.
Type sbar_demo
for an example, or see this blog post.
Prepares the course datasets from the original ones (if available). All datasets are saved in Stata 9/10 format for backward compatibility.
Uses the srqm_datamake
and srqm_datatrim
subroutines.
Runs the course do-files, separately or sequentially.
- Use the
s()
option to select the sessions to run, as ins(1/12)
to run the entire course. - Use the
test
option to perform a clean run of the course that tests therequire
package calls - Use the
wipe
option to clean all workfiles at the end of the demo - You can
log
that command by passing ausing
argument to it.
Downloads files from an online access point to the course folders. Sometimes used in class to distribute updated versions of the code, programs and slides for the course.
Compatibility:
- The default access point is set to allow HTTP connexions only, which means that this utility should work with older versions of Stata (12-).
- I was not able to support HTTPS connexions due to my server using an AES encryption scheme that is not supported by Stata 13.
Notes:
- Formerly called
srqm_copy
. - [TOFIX] Type
srqm_get demo.do
for an example.
Signs the architecture of the SRQM
folder, a.k.a the 'Teaching Pack', by checking that all course utilities are present in the folder, and by printing information related to the four global macros used by the course:
-
$SRQM_WD
: path to theSRQM
folder -
$SRQM_FOLDERS
: names of thecode
,data
andsetup
folders -
$SRQM_DATASETS
: names of the datasets stored in thedata
folder and used by the course do-files -
$SRQM_PACKAGES
: names of the Stata packages used by the course do-files
Notes:
- [TODO]: if not, download them from SRQM remote access point?
Checks whether Stata is being told to automatically run from the SRQM
folder by checking the folder path to the global macro $srqm_wd
. If this is not the case, the macro is written into a profile.do
file located in the Stata application folder.
The profile.do
file saved to the Stata application folder acts as a symbolic link that also runs the profile.do
file from the SRQM folder, which modifies some Stata settings and performs further integrity checks on the course setup with srqm_scan
and srqm_pkgs
.
Compatibility:
- This command was written back in the days when Stata 11 (and possibly Stata 12) did not have an option to start in the last session's current working directory.
- On Windows Vista and above, the command requires running Stata as administrator, or it will fail due to a system restriction in recent versions of Windows.
Checks whether the additional Stata packages used in the course do-files have been installed and installs them if necessary.
Compatibility:
- The command requires an Internet connexion.
- The command relies on the
pkgs
utility located inutils.ado
.
Notes:
- The course packages include the burd graph scheme, which was developed for the course.
- The command tries to run as quickly as possible by skipping packages that are already installed.
- When necessary, the command will try to bypass admin restrictions by cycling through several install locations.
Checks whether the data
and code
folders exist in the SRQM
folder, and restores the course datasets from their ZIP
archives if they have been deleted.
Folder-by-folder details:
-
code
: check all course do-files are present- [TOFIX] if not, tries to download them via
srqm_grab
- [TODO] use GitHub as last-resort access point?
- [TOFIX] if not, tries to download them via
-
data
: check all course datasets are present- if not, unzip the backup copy (routine:
srqm_scan.ado
) - if no backup copy, try to assemble from source (routine:
srqm_data
+ do-files indata/
folder)
- if not, unzip the backup copy (routine:
Cleans up the SRQM
folder by erasing temporary workfiles (logs and tables) produced by the course do-files.
Produces summary statistics and correlation matrix tables in plain text format, for maximum compatibility with external editors like Google Documents. Relies on Ben Jann's estout
command.
Type stab_demo
for an example, or see this blog post.
Undocumented shortcut commands that slightly modify the behaviour of a few built-in Stata commands.
-
find
: a quickerlookfor
command. -
load
: a quickeruse
command. -
pkgs
: determines whether a folder can be used to install Stata packages -
science
: Easter egg -
updates
: updates all installed packages -
wipe
: clean up temporary files