Skip to content

barthlab/RegressionDiscontinuityTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Regression Discontinuity Tree

Lightweight Tkinter app for running a regression discontinuity tree (RDT) analysis on an Excel sheet. Pick a running variable and outcome column, then the app fits a decision tree, finds an optimal cutoff, runs basic stats, and plots the results.

Requirements

  • Python 3.x with GUI support (Tkinter)
  • Packages: pandas, numpy, matplotlib, scikit-learn, scipy

Install deps:

pip install pandas numpy matplotlib scikit-learn scipy

Usage

  1. Place your data in an .xls/.xlsx file with at least a running variable, an outcome variable, and an optional GrpTrain column for coloring points.
  2. Run the app:
python RDD_Test_V6.py
  1. In the window, choose the Excel file, select the X (running) and Y (outcome) columns, then click Run RDT Analysis. Choose the cutoff method (auto or manual) when prompted. Enter a training group name to color the final bar plot.

What you get

  • Scatter plot with regression line and tree-derived cutoff
  • Visualized decision tree
  • Cross-validated MSE and bootstrap CI for the fitted tree
  • Mann–Whitney, t-test, permutation test, and a bar plot comparing means across the cutoff

About

RDD analysis code for the paper "Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages