Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

calc_effect_size

Calculate and interpret statistical effect sizes including Cohen's d, η², f², odds ratio, and correlation for quantitative research analysis.

Instructions

효과크기 계산 및 해석 (Cohen's d, η², f², OR, RR)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes효과크기 유형
valuesYes계산에 필요한 값들

Implementation Reference

  • The handler function that executes the calc_effect_size tool logic, computing various effect sizes (Cohen's d, eta², f², OR) based on input type and values, with interpretations.
    function handleCalcEffectSize(args: Record<string, unknown>) {
      const type = args.type as string;
      const values = args.values as Record<string, number>;
    
      let result: any = { type };
    
      switch (type) {
        case "cohens_d":
          if (values.mean1 && values.mean2 && values.sd_pooled) {
            result.effect_size = ((values.mean1 - values.mean2) / values.sd_pooled).toFixed(3);
          } else if (values.t && values.n1 && values.n2) {
            result.effect_size = (values.t * Math.sqrt((values.n1 + values.n2) / (values.n1 * values.n2))).toFixed(3);
          }
          result.interpretation = {
            small: "0.2", medium: "0.5", large: "0.8"
          };
          break;
        case "eta_squared":
          if (values.ss_effect && values.ss_total) {
            result.effect_size = (values.ss_effect / values.ss_total).toFixed(3);
          }
          result.interpretation = {
            small: "0.01", medium: "0.06", large: "0.14"
          };
          break;
        case "f_squared":
          if (values.r_squared) {
            result.effect_size = (values.r_squared / (1 - values.r_squared)).toFixed(3);
          }
          result.interpretation = {
            small: "0.02", medium: "0.15", large: "0.35"
          };
          break;
        case "odds_ratio":
          if (values.or) {
            result.effect_size = values.or;
            result.cohens_d_approx = (Math.log(values.or) * Math.sqrt(3) / Math.PI).toFixed(3);
          }
          break;
      }
    
      return result;
    }
  • Input schema definition for the calc_effect_size tool, specifying the type enum and values object.
    inputSchema: {
      type: "object",
      properties: {
        type: {
          type: "string",
          enum: ["cohens_d", "eta_squared", "f_squared", "odds_ratio", "correlation"],
          description: "효과크기 유형"
        },
        values: { type: "object", description: "계산에 필요한 값들" },
      },
      required: ["type", "values"],
    },
  • Registration of the calc_effect_size tool in the exported tools array.
      name: "calc_effect_size",
      description: "효과크기 계산 및 해석 (Cohen's d, η², f², OR, RR)",
      inputSchema: {
        type: "object",
        properties: {
          type: {
            type: "string",
            enum: ["cohens_d", "eta_squared", "f_squared", "odds_ratio", "correlation"],
            description: "효과크기 유형"
          },
          values: { type: "object", description: "계산에 필요한 값들" },
        },
        required: ["type", "values"],
      },
    },
  • Dispatch case in handleToolCall function that routes calls to the effect size handler.
    case "calc_effect_size":
      return handleCalcEffectSize(args);

Latest Blog Posts

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/seanshin0214/quantmaster-mcp-server'

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