GithubHelp home page GithubHelp logo

fixedeffectmodel's Introduction

FixedEffectModel

This is a Python Package that provides solutions for linear model with high dimensional fixed effects, including support for calculation in variance (robust variance and multi-way cluster variance), fixed effects, and standard error of fixed effects.

Installation

Install this package directly from PyPI

$ pip install FixedEffectModel

Main Functions

Function name Description Usage
ols_high_d_category get main result ols_high_d_category(data_df, consist_input=None, out_input=None, category_input=None, cluster_input=[],formula=None, robust=False, c_method='cgm', psdef=True, epsilon=1e-8, max_iter=1e6, process=5)
ols_high_d_category_multi_results get results of multiple models based on same dataset ols_high_d_category_multi_results(data_df, models, table_header)
getfe get fixed effects getfe(result, epsilon=1e-8)
alpha_std get standard error of fixed effects alpha_std(result, formula, sample_num=100)

Example

import FixedEffectModel.api as FEM
import pandas as pd

df = pd.read_csv('yourdata.csv')

#define model:'dependent variable ~ continuous variable|fixed_effect|clusters'
formula = 'y~x+x2|id+firm|id+firm'
result1 = FEM.ols_high_d_category(df, formula = formula,robust=False,c_method = 'cgm',epsilon = 1e-8,psdef= True,max_iter = 1e6)

#show result
result1.summary()

#get fixed effects
getfe(result1 , epsilon=1e-8)

#define the expression of standard error of difference between two fixed effect estimations you want to know
expression = 'id_1-id_2'
#get standard error
alpha_std(result1, formula = expression , sample_num=100)

Requirements

  • Python 3.6+
  • Pandas and its dependencies (Numpy, etc.)
  • Scipy and its dependencies
  • statsmodels and its dependencies

fixedeffectmodel's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.