Sample Size Calculator for Mediation Analysis

Estimate mediation sample size with power and path values. Adjust alpha, attrition, design effect, covariates. Export clear results before planning complex studies with confidence.

Calculator Inputs

Formula Used

Indirect effect: ab = a × b

Standard error: SE(ab) = √(b²SE(a)² + a²SE(b)² + SE(a)²SE(b)²)

Required z: z target = z alpha + z power

Decision rule: smallest N where |ab| ÷ SE(ab) is at least z target

Adjusted start sample: adjusted N = N × method factor × design effect ÷ retention rate

This calculator uses standardized path estimates. It is best for planning and scenario comparison. Confirm final protocols with simulation when the model is complex.

How to Use This Calculator

  1. Enter the expected path a value from predictor to mediator.
  2. Enter the expected path b value from mediator to outcome.
  3. Add the direct path if you want the mediated percent.
  4. Select alpha, target power, and test direction.
  5. Add model R squared values when pilot estimates exist.
  6. Enter covariates, design effect, and expected attrition.
  7. Press the calculate button to view results above the form.
  8. Use CSV or PDF buttons to save the result.

Example Data Table

Scenario Path a Path b Power Estimated Base Cases
Small indirect effect 0.18 0.20 80% 369
Moderate indirect effect 0.26 0.30 80% 174
Strong indirect effect 0.35 0.40 90% 130

Sample Size Planning for Mediation Analysis

Mediation analysis is useful when a physics study explores a process. A researcher may test whether one variable changes another through an intermediate factor. For example, a field strength may affect detector response through temperature drift. The indirect effect is the product of two paths. The first path links the predictor to the mediator. The second path links the mediator to the outcome. A clear sample size plan helps this chain get tested with enough power.

Why Power Matters

Indirect effects are often smaller than direct effects. They can be difficult to detect. Small path values need larger samples. Higher power also increases the required sample. The alpha level changes the critical value. A stricter alpha protects against false claims. Yet it also raises the needed sample. Attrition matters too. Lost observations reduce usable data. This calculator adds an attrition adjustment so the starting sample can be planned early.

Physics Use Cases

Physics projects may use mediation when the mechanism matters. A material treatment may influence conductivity through grain size. Radiation exposure may affect sensor error through charge trapping. A cooling method may change signal quality through thermal noise. In each case, the mediator explains part of the relationship. The tool gives a practical planning estimate before collection begins. It can also support pilot studies and grant notes.

Inputs and Interpretation

The calculator uses standardized path coefficients. Enter the expected a path and b path. These values often come from pilot data, theory, or related experiments. Choose a power target and significance level. Add covariates when the model includes controls. Use design effect for clustered or repeated measurements. Use one tailed testing only when the direction is justified. The adjusted sample is usually the number to recruit.

Practical Notes

The result is an approximation, not a final protocol. Mediation power can depend on nonnormal products, measurement error, and model structure. Bootstrap tests can behave differently from a Sobel style estimate. Still, the estimate is useful for screening scenarios. Try several path values. Compare conservative and optimistic assumptions. Save the exports for documentation. When stakes are high, confirm the design with simulation or a statistician. This keeps planning transparent and easier to review later carefully.

FAQs

What is mediation analysis?

Mediation analysis tests whether a predictor affects an outcome through an intermediate variable. The intermediate variable is called the mediator.

What does path a mean?

Path a is the expected relationship between the predictor and mediator. Use a standardized coefficient from theory, pilot data, or prior work.

What does path b mean?

Path b is the expected relationship between the mediator and outcome after controlling for the predictor and selected covariates.

Why is the indirect effect multiplied?

The indirect effect is the product of path a and path b. It represents the strength of the mediated pathway.

Should I use one tailed testing?

Use one tailed testing only when theory strongly supports one direction. Two tailed testing is safer for most research plans.

Why add attrition?

Attrition reduces the usable final sample. The calculator increases the starting sample so enough complete cases remain for analysis.

What is design effect?

Design effect adjusts sample size for clustering, repeated measures, or other designs that reduce independent information.

Is this calculator final proof?

No. It gives a planning estimate. Complex mediation models should be checked with simulation or expert statistical review.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.