|
345 | 345 | "We know that the correct gradient change is 2, and that we have correctly recovered it as the posterior distribution is centred around 2." |
346 | 346 | ] |
347 | 347 | }, |
| 348 | + { |
| 349 | + "cell_type": "markdown", |
| 350 | + "metadata": {}, |
| 351 | + "source": [ |
| 352 | + "We can also ask for summary information:" |
| 353 | + ] |
| 354 | + }, |
| 355 | + { |
| 356 | + "cell_type": "code", |
| 357 | + "execution_count": 8, |
| 358 | + "metadata": {}, |
| 359 | + "outputs": [ |
| 360 | + { |
| 361 | + "name": "stdout", |
| 362 | + "output_type": "stream", |
| 363 | + "text": [ |
| 364 | + "================================Regression Kink=================================\n", |
| 365 | + "Formula: y ~ 1 + x + I((x-0.5)*treated)\n", |
| 366 | + "Running variable: x\n", |
| 367 | + "Kink point on running variable: 0.5\n", |
| 368 | + "\n", |
| 369 | + "Results:\n", |
| 370 | + "Change in slope at kink point = 1.93\n", |
| 371 | + "Model coefficients:\n", |
| 372 | + "Intercept -0.01, 94% HDI [-0.02, 0.01]\n", |
| 373 | + "x -0.99, 94% HDI [-1.01, -0.96]\n", |
| 374 | + "I((x - 0.5) * treated) 1.93, 94% HDI [1.77, 2.10]\n", |
| 375 | + "sigma 0.04, 94% HDI [0.03, 0.05]\n" |
| 376 | + ] |
| 377 | + } |
| 378 | + ], |
| 379 | + "source": [ |
| 380 | + "result1.summary()" |
| 381 | + ] |
| 382 | + }, |
348 | 383 | { |
349 | 384 | "cell_type": "markdown", |
350 | 385 | "metadata": {}, |
|
368 | 403 | }, |
369 | 404 | { |
370 | 405 | "cell_type": "code", |
371 | | - "execution_count": 8, |
| 406 | + "execution_count": 9, |
372 | 407 | "metadata": {}, |
373 | 408 | "outputs": [ |
374 | 409 | { |
|
400 | 435 | }, |
401 | 436 | { |
402 | 437 | "cell_type": "code", |
403 | | - "execution_count": 9, |
| 438 | + "execution_count": 10, |
404 | 439 | "metadata": {}, |
405 | 440 | "outputs": [ |
406 | 441 | { |
|
461 | 496 | "name": "stderr", |
462 | 497 | "output_type": "stream", |
463 | 498 | "text": [ |
464 | | - "Sampling 4 chains for 5_000 tune and 1_000 draw iterations (20_000 + 4_000 draws total) took 10 seconds.\n", |
| 499 | + "Sampling 4 chains for 5_000 tune and 1_000 draw iterations (20_000 + 4_000 draws total) took 11 seconds.\n", |
465 | 500 | "Sampling: [beta, sigma, y_hat]\n", |
466 | 501 | "Sampling: [y_hat]\n", |
467 | 502 | "Sampling: [y_hat]\n", |
|
510 | 545 | }, |
511 | 546 | { |
512 | 547 | "cell_type": "code", |
513 | | - "execution_count": 10, |
| 548 | + "execution_count": 11, |
514 | 549 | "metadata": {}, |
515 | 550 | "outputs": [ |
516 | 551 | { |
|
542 | 577 | }, |
543 | 578 | { |
544 | 579 | "cell_type": "code", |
545 | | - "execution_count": 11, |
| 580 | + "execution_count": 12, |
546 | 581 | "metadata": {}, |
547 | 582 | "outputs": [ |
548 | 583 | { |
|
576 | 611 | }, |
577 | 612 | { |
578 | 613 | "cell_type": "code", |
579 | | - "execution_count": 12, |
| 614 | + "execution_count": 13, |
580 | 615 | "metadata": {}, |
581 | 616 | "outputs": [ |
582 | 617 | { |
|
611 | 646 | }, |
612 | 647 | { |
613 | 648 | "cell_type": "code", |
614 | | - "execution_count": 13, |
| 649 | + "execution_count": 14, |
615 | 650 | "metadata": {}, |
616 | 651 | "outputs": [ |
617 | 652 | { |
|
709 | 744 | }, |
710 | 745 | { |
711 | 746 | "cell_type": "code", |
712 | | - "execution_count": 14, |
| 747 | + "execution_count": 15, |
713 | 748 | "metadata": {}, |
714 | 749 | "outputs": [ |
715 | 750 | { |
|
0 commit comments