R Econometrics MCP Server

Integrations

  • Provides containerized deployment of the R Econometrics MCP server, allowing for easier setup and isolation of the required R environment and dependencies.

  • Uses Python as the interface language for the MCP server that connects R's econometric capabilities to AI assistants.

R計量経済学MCPサーバー

R を通じて計量経済モデリング機能を提供するモデル コンテキスト プロトコル (MCP) サーバー。このサーバーにより、AI アシスタントは線形回帰、パネル データ モデル、操作変数回帰、診断テストなどの高度な計量経済分析を実行できます。

特徴

  • 線形回帰:オプションのロバスト標準誤差を使用して線形モデルを実行します。
  • パネルデータ分析:固定効果、ランダム効果、プール、間、および一次差モデル
  • 操作変数:IV回帰モデルの推定
  • 診断テスト:異分散性、自己相関、関数形式テスト
  • リソース: 計量経済学的手法に関する参考資料
  • プロンプト: 一般的な計量経済分析のための事前定義されたプロンプトテンプレート

インストール

前提条件

  • Python 3.8以上
  • R 4.0以上
  • R パッケージ: plm、lmtest、sandwich、AER、jsonlite

Dockerの使用(推奨)

  1. Docker イメージをビルドします。
    docker build -t r-econometrics-mcp .
  2. コンテナを実行します。
    docker run -it r-econometrics-mcp

手動インストール

  1. 必要な Python パッケージをインストールします。
    pip install -r requirements.txt
  2. 必要な R パッケージをインストールします。
    install.packages(c("plm", "lmtest", "sandwich", "AER", "jsonlite"))
  3. サーバーを実行します。
    python r_econometrics_mcp.py

Claude Desktopでの使用

  1. Claudeデスクトップを起動
  2. MCPサーバーパネルを開く
  3. 次の構成で新しいサーバーを追加します。
    • 名前: R計量経済学
    • トランスポート: stdio
    • コマンド: path/to/python r_econometrics_mcp.py
    • (またはDockerを使用している場合): docker run -i r-econometrics-mcp

クエリの例

サーバーが接続されたら、Claude で使用できるクエリの例を次に示します。

線形回帰

Can you analyze the relationship between price and mpg in the mtcars dataset using linear regression?

パネルデータ分析

I have panel data with variables gdp, investment, and trade for 30 countries over 20 years. Can you help me determine if a fixed effects or random effects model is more appropriate?

操作変数

I'm trying to estimate the causal effect of education on wages, but I'm concerned about endogeneity. Can you help me set up an instrumental variables regression?

診断テスト

After running my regression model, I'm concerned about heteroskedasticity. Can you run appropriate diagnostic tests and suggest corrections if needed?

ツールリファレンス

線形モデル

線形回帰モデルを実行します。

パラメータ:

  • formula (文字列):回帰式(例:'y ~ x1 + x2')
  • data (オブジェクト): 辞書/JSON オブジェクトとしてのデータセット
  • robust (ブール値、オプション):ロバスト標準誤差を使用するかどうか

パネルモデル

パネル データ モデルを実行します。

パラメータ:

  • formula (文字列):回帰式(例:'y ~ x1 + x2')
  • data (オブジェクト): 辞書/JSON オブジェクトとしてのデータセット
  • index (配列):パネルのインデックス変数(例:['individual', 'time'])
  • effect (文字列、オプション): 効果の種類: 'individual'、'time'、または 'twoways'
  • model (文字列、オプション): モデルタイプ: 'within'、'random'、'pooling'、'between'、または 'fd'

診断

モデル診断を実行します。

パラメータ:

  • formula (文字列):回帰式(例:'y ~ x1 + x2')
  • data (オブジェクト): 辞書/JSON オブジェクトとしてのデータセット
  • tests (配列): 実行するテスト (例: ['bp', 'reset', 'dw'])

iv_回帰

操作変数回帰を推定します。

パラメータ:

  • formula (文字列): 回帰式 (例: 'y ~ x1 + x2 | z1 + z2')
  • data (オブジェクト): 辞書/JSON オブジェクトとしてのデータセット

リソース

  • econometrics:formulas :一般的な計量経済モデルの定式化に関する情報
  • econometrics:diagnostics :診断テストの参考文献
  • econometrics:panel_data :Rによるパネルデータ分析ガイド

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

MITライセンス

謝辞

  • RプロジェクトとRコアチーム
  • plm、lmtest、sandwich、AER パッケージの開発者
  • モデルコンテキストプロトコルのAnthropic
-
security - not tested
A
license - permissive license
-
quality - not tested

R を通じて計量経済モデリング機能を提供し、AI アシスタントが線形回帰、パネル データ モデル、操作変数回帰、診断テストなどの高度な分析を実行できるようにします。

  1. Features
    1. Installation
      1. Prerequisites
      2. Using Docker (Recommended)
      3. Manual Installation
    2. Usage with Claude Desktop
      1. Example Queries
        1. Linear Regression
        2. Panel Data Analysis
        3. Instrumental Variables
        4. Diagnostic Tests
      2. Tools Reference
        1. linear_model
        2. panel_model
        3. diagnostics
        4. iv_regression
      3. Resources
        1. Contributing
          1. License
            1. Acknowledgments
              ID: qiqzedafdr