Skip to main content
Glama

R Econometrics MCP Server

R MCP 서버

R을 통해 고급 계량경제 모델링 및 데이터 분석 기능을 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버를 사용하면 AI 도우미가 정교한 계량경제 및 통계 분석을 원활하게 수행하여 데이터에서 빠르게 통찰력을 얻을 수 있습니다.

특징

  • 선형 회귀: 선택적으로 견고한 표준 오차를 적용하여 선형 모델을 실행합니다.
  • 패널 데이터 분석: 고정 효과, 임의 효과, 풀링, 모형 간, 1차 차분 모형을 추정합니다.
  • 도구 변수: IV 회귀 모델을 구축하고 추정합니다.
  • 진단 테스트: 이분산성, 자기상관 및 모델 오류 지정을 평가합니다.
  • 기술 통계: R의 summary() 기능을 사용하여 데이터 세트에 대한 요약 통계를 생성합니다.
  • 상관관계 분석: 변수 간의 피어슨 또는 스피어만 상관관계를 계산합니다.
  • 그룹화 집계: dplyr을 사용하여 지정된 열별로 데이터를 그룹화하고 요약 통계를 계산합니다.
  • 리소스: 다양한 계량경제학 기술에 대한 참고 문서에 접근하세요.
  • 프롬프트: 일반적인 경제통계 분석을 위해 미리 정의된 프롬프트 템플릿을 사용합니다.

설치

Docker 사용(권장)

  1. Docker 이미지를 빌드합니다.지엑스피1
  2. 컨테이너를 실행합니다.
docker run -it r-econometrics-mcp

수동 설치

필요한 Python 패키지를 설치하세요.

pip install -r requirements.txt

필수 R 패키지를 설치합니다(컨테이너 외부에서 서버를 실행하는 경우):

install.packages(c("plm", "lmtest", "sandwich", "AER", "jsonlite"), repos="https://cloud.r-project.org/")

서버를 실행합니다:

python rmcp.py

용법

서버는 표준 입출력(STIO)을 통해 통신합니다. 다음을 실행하면:

python rmcp.py

서버를 시작하고 표준 입력에서 JSON 메시지를 기다립니다. 서버를 수동으로 테스트하려면 간결한(한 줄) JSON 메시지가 포함된 파일(예: test_request.json)을 만드세요.

예제 테스트

다음 내용(한 줄 JSON)으로 test_request.json을 만듭니다.

{"tool": "linear_model", "args": {"formula": "y ~ x1", "data": {"x1": [1,2,3,4,5], "y": [1,3,5,7,9]}, "robust": false}}

그런 다음 실행하세요.

cat test_request.json | python rmcp.py

산출

{"coefficients": {"(Intercept)": -1, "x1": 2}, "std_errors": {"(Intercept)": 2.8408e-16, "x1": 8.5654e-17}, "t_values": {"(Intercept)": -3520120717017444, "x1": 23349839270207356}, "p_values": {"(Intercept)": 5.0559e-47, "x1": 1.7323e-49}, "r_squared": 1, "adj_r_squared": 1, "sigma": 2.7086e-16, "df": [2, 3, 2], "model_call": "lm(formula = formula, data = data)", "robust": false}

Claude Desktop과 함께 사용

  1. Claude Desktop 실행
  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 (배열): 패널 인덱스 변수(예: ['개인', '시간'])
  • effect (문자열, 선택 사항): 효과 유형: '개별', '시간' 또는 '2가지'
  • 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 라이센스

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

R을 통해 계량경제 모델링 기능을 제공하여 AI 보조자가 선형 회귀, 패널 데이터 모델, 계측 변수 회귀, 진단 테스트를 포함한 정교한 분석을 수행할 수 있도록 합니다.

  1. 특징
    1. 설치
      1. Docker 사용(권장)
      2. 수동 설치
    2. 용법
      1. 예제 테스트
    3. Claude Desktop과 함께 사용
      1. 예제 쿼리
        1. 선형 회귀
        2. 패널 데이터 분석
        3. 도구 변수
        4. 진단 검사
      2. 도구 참조
        1. 선형 모델
        2. 패널\_모델
        3. 진단
        4. iv\_회귀
      3. 자원
        1. 기여하다
          1. 특허

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
              Last updated -
              1
              580
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              Serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices.
              Last updated -
              4
              87
              52
              TypeScript
              MIT License
            • -
              security
              F
              license
              -
              quality
              Enables AI models to interact with Linear for issue tracking and project management through capabilities like creating/searching issues, managing sprints, and retrieving workflow states.
              Last updated -
              TypeScript
            • A
              security
              F
              license
              A
              quality
              Enables AI assistants to interact with the World Bank open data API, allowing for listing and analysis of indicators across available countries.
              Last updated -
              1
              8
              Python

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/finite-sample/rmcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server