Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stataconda

Overview

Stataconda is a desktop GUI application that provides a Stata-like interface while applying Python's data science ecosystem under the hood. It accepts Stata commands, translates them into Python (using pandas, statsmodels, seaborn, etc.), executes the Python code, and formats the output to match Stata's familiar style.

Features

  • Stata-like Interface: Familiar command syntax and output formatting
  • Python Backend: Leverages pandas, statsmodels, scikit-learn, and other Python libraries
  • Interactive GUI: Command prompt, results window, variable list, and data browser
  • Data Management: Support for CSV, Excel, and Stata .dta files
  • Statistical Analysis: Comprehensive set of statistical commands
  • Visualization: Rich plotting capabilities with matplotlib and seaborn
  • Bash Integration: Execute shell commands directly from the interface

Installation

# Clone the repository
git clone https://github.com/elliottash/stataconda.git
cd stataconda

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

Quick Start

  1. Launch the application
  2. Load a dataset using use filename.dta or import filename.csv
  3. Explore data with browse, summarize, or describe
  4. Run analyses using Stata-like commands
  5. Save results using save filename.dta

Detailed Command Documentation

Data Management Commands

use / import

Load a dataset from a file.

use filename.dta
import filename.csv
  • Supports .dta, .csv, and .xlsx files
  • Automatically detects file type from extension
  • Updates variable list and data browser

save

Save the current dataset to a file.

save filename.dta
  • Supports .dta, .csv, and .xlsx files
  • Defaults to .dta if no extension provided

export

Export results to various formats.

export using filename.rtf
  • Supports .rtf, .csv, .xlsx, .html, .tex formats
  • Used primarily for exporting regression results

Data Exploration Commands

browse

Open the data browser to view and edit data.

browse
browse var1 var2

describe

Display overview of dataset variables.

describe
describe var1 var2

summarize

Calculate summary statistics.

summarize
summarize var1 var2

tabulate

Create frequency tables.

tabulate var1
tabulate var1 var2

Data Manipulation Commands

generate

Create new variables.

generate newvar = expression

replace

Modify existing variables.

replace var = expression

drop

Remove variables or observations.

drop var1 var2
drop if condition

keep

Keep specified variables or observations.

keep var1 var2
keep if condition

rename

Rename variables.

rename oldvar newvar

recode

Recode variable values.

recode var (1=2) (2=1)

clonevar

Create a copy of a variable.

clonevar newvar = oldvar

Label Commands

label variable

Add variable labels.

label variable var "label"

label values

Add value labels.

label values var valuelist

Data Combination Commands

append

Append datasets.

append using filename

merge

Merge datasets.

merge 1:1 keyvar using filename

joinby

Join datasets by key variables.

joinby keyvar using filename

cross

Create cross-product of datasets.

cross using filename

Statistical Analysis Commands

regress

Linear regression.

regress depvar indepvar1 indepvar2 [, options]

anova

Analysis of variance.

anova depvar indepvar1 indepvar2

areg

Linear regression with absorbed fixed effects.

areg depvar indepvar1 indepvar2, absorb(groupvar)

xtreg

Panel data regression.

xtreg depvar indepvar1 indepvar2, fe

fe

Fixed effects regression.

fe depvar indepvar1 indepvar2

logit / probit / logistic

Binary outcome models.

logit depvar indepvar1 indepvar2
probit depvar indepvar1 indepvar2
logistic depvar indepvar1 indepvar2

poisson / nbreg

Count data models.

poisson depvar indepvar1 indepvar2
nbreg depvar indepvar1 indepvar2

tobit / intreg

Censored/interval regression models.

tobit depvar indepvar1 indepvar2
intreg depvar indepvar1 indepvar2

ivregress / ivreg2

Instrumental variables regression.

ivregress 2sls depvar (endogvar = instrument) exogvar1 exogvar2
ivreg2 depvar (endogvar = instrument) exogvar1 exogvar2

Time Series Commands

xtset / tsset

Set panel/time series structure.

xtset panelvar timevar
tsset timevar

arima

ARIMA modeling.

arima depvar, arima(p,d,q)

arch

ARCH/GARCH modeling.

arch depvar, arch(1) garch(1)

var / vec

Vector autoregression/error correction.

var depvar1 depvar2, lags(2)
vec depvar1 depvar2, lags(2)

newey

Newey-West regression.

newey depvar indepvar1 indepvar2, lag(2)

Visualization Commands

scatter

Create scatter plots.

scatter yvar xvar [, options]

histogram

Create histograms.

histogram var [, options]

graph bar

Create bar graphs.

graph bar var [, options]

binscatter

Create binned scatter plots.

binscatter yvar xvar [, options]

coefplot

Plot regression coefficients.

coefplot model1 model2 [, options]

lgraph

Create line graphs.

lgraph yvar xvar [groupvar] [, options]

Estimation Results Commands

estout / esttab

Format and export estimation results.

estout using filename.rtf
esttab using filename.rtf

estadd

Add statistics to stored estimates.

estadd local statname value

eststo

Store estimation results.

eststo name: command

Utility Commands

bash

Execute shell commands.

bash command

do

Execute a do-file.

do filename.do

egen

Generate extended variables.

egen newvar = function(arguments)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

an open-source IDE that runs both stata and python code.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages