{ "cells": [ { "cell_type": "markdown", "id": "third-wrapping", "metadata": {}, "source": [ "# Stata Kernel Demo\n", "\n", "Publishing in a `jupyter-book` from an `ipynb` notebook with `stata_kernel`" ] }, { "cell_type": "code", "execution_count": 1, "id": "minor-merit", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1978 automobile data)\n" ] } ], "source": [ "sysuse auto" ] }, { "cell_type": "code", "execution_count": 2, "id": "separate-caribbean", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " Variable | Obs Mean Std. dev. Min Max\n", "-------------+---------------------------------------------------------\n", " make | 0\n", " price | 74 6165.257 2949.496 3291 15906\n", " mpg | 74 21.2973 5.785503 12 41\n", " rep78 | 69 3.405797 .9899323 1 5\n", " headroom | 74 2.993243 .8459948 1.5 5\n", "-------------+---------------------------------------------------------\n", " trunk | 74 13.75676 4.277404 5 23\n", " weight | 74 3019.459 777.1936 1760 4840\n", " length | 74 187.9324 22.26634 142 233\n", " turn | 74 39.64865 4.399354 31 51\n", "displacement | 74 197.2973 91.83722 79 425\n", "-------------+---------------------------------------------------------\n", " gear_ratio | 74 3.014865 .4562871 2.19 3.89\n", " foreign | 74 .2972973 .4601885 0 1\n" ] } ], "source": [ "sum" ] }, { "cell_type": "code", "execution_count": 4, "id": "dimensional-violation", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(running regress on estimation sample)\n", "\n", "Bootstrap replications (50)\n", "----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 \n", ".................................................. 50\n", "\n", "Linear regression Number of obs = 74\n", " Replications = 50\n", " Wald chi2(2) = 20.14\n", " Prob > chi2 = 0.0000\n", " R-squared = 0.2222\n", " Adj R-squared = 0.2003\n", " Root MSE = 2637.5910\n", "\n", "------------------------------------------------------------------------------\n", " | Observed Bootstrap Normal-based\n", " price | coefficient std. err. z P>|z| [95% conf. interval]\n", "-------------+----------------------------------------------------------------\n", " mpg | -220.1649 77.9294 -2.83 0.005 -372.9037 -67.42607\n", " trunk | 43.55851 80.76242 0.54 0.590 -114.7329 201.8499\n", " _cons | 10254.95 2692.185 3.81 0.000 4978.363 15531.54\n", "------------------------------------------------------------------------------\n" ] } ], "source": [ "bstrap: reg price mpg trunk" ] } ], "metadata": { "kernelspec": { "display_name": "Stata", "language": "stata", "name": "stata" }, "language_info": { "codemirror_mode": "stata", "file_extension": ".do", "mimetype": "text/x-stata", "name": "stata", "version": "15.1" } }, "nbformat": 4, "nbformat_minor": 5 }