Jupyter kernel for Stata based on pystata
Project description
Welcome to nbstata
Click here for the nbstata User Guide
What is Jupyter?
JupyterLab is a browser-based editor that allows you to combine interactive code and results with Markdown in a single document (called a Jupyter notebook). It is open source and widely used. Though it is named after the three core programming languages it supports (Julia, Python, and R), it can be used with with a wide variety of languages.
nbstata
allows you to create Stata notebooks (as opposed to using
Stata within a Python notebook, which is a nice way to embed Stata
commands within Python
code but
is needlessly clunky if you are working primarily with Stata).
nbstata
features
- Easy setup
- Works with Stata 17 (only).
- Displays Stata output without the redundant ‘echo’ of (multi-line) commands
- Autocompletion for variables, macros, matrices, and file paths
- DataGrid widget with
browse
-like capabilities (e.g., interactive filtering) - Variable and data properties (
describe
ande
/return list
) available in a ‘contextual help’ side panel - Interactive/richtext help files accessible within notebook
-
#delimit ;
interactive support (along with all types of comments)
What can you do with Stata notebooks…
…that you can’t do with the official Stata interface?
- Exploratory analysis that is both:
- interactive
- preserved for future reference/editing
- Present results in a way that interweaves:[1]
- code
- results (including graphs)
- rich text:
- lists
- Headings
- links
- math: $y_{it}=\beta_0+\varepsilon_{it}$
[1] Stata dynamic documents can do this part, but with a very different, less interactive workflow. (See also: markstat, stmd, and Statamarkdown)
Contributing
nbstata
is being developed using
nbdev.
The /nbs
directory is where edits to the source code should be made.
(The python code is then exported to the /nbdev
library folder.) The
one exception is install.py
.
The @patch_to decorator is occasionally used to break up class definitions into separate cells.
For more, see CONTRIBUTING.md.
Acknowledgements
Kyle Barron authored the original stata_kernel
and Vinci Chow carried
that work forward for Stata 17, converting the backend to use
pystata. nbstata
was
originally derived from his
pystata-kernel, but much
of the docs and newer features are derived directly from stata_kernel
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.