Skip to main content
v2026.11,858 entries · CC-BY 4.0

Power Regression: Formula, Worked Example and How to Calculate It

Power regression fits y = Ax^B by least squares on logs. Formula, a worked example with arithmetic, reading the exponent, and Excel, R and Python.

Written and maintained by CASRAI Editorial Board

Last updated

Power regression fits the model y = AxB to paired data where both variables are positive and y changes by a constant percentage when x changes by a constant percentage. The usual method takes logarithms of both variables and fits a straight line. This page gives the formula, a fully worked example with the arithmetic shown, a table for reading the exponent, and short Excel, R and Python recipes. It also shows that fitting on the log scale and fitting the power curve directly return different estimates from the same data.

What is power regression?

Power regression is a curve-fitting method for the model y = AxB, where A is a positive scale constant and B is the exponent. Taking natural logarithms of both sides gives ln y = ln A + B ln x, a straight line in the logged variables, so ordinary least squares can estimate it (Weisstein, MathWorld, “Least Squares Fitting–Power Law”, read 2026-11-08; Real Statistics, “Power Regression Basic Concepts”, read 2026-11-08). Because the fitted line is straight on log-log axes, the method is sometimes called log-log regression.

Power regression formula

Write the model as y = AxB and the linearised form as ln y = a + b ln x, with a = ln A and b = B. For n observations, least squares on the logged values gives:

b = [n Σ(ln x)(ln y) − Σln x · Σln y] / [n Σ(ln x)² − (Σln x)²]

a = (Σln y − b Σln x) / n, then A = ea and B = b.

  • x, y: the observed predictor and response; every value must be greater than zero because logarithms are undefined otherwise.
  • n: the number of (x, y) pairs.
  • b (= B): the slope of the log-log line, which is the exponent of the power curve.
  • a: the intercept of the log-log line, the value of ln y when ln x = 0.
  • A = ea: the multiplier of the power curve, the fitted y at x = 1.

The log transform only works for the pure form. A model such as y = AxB + C cannot be linearised by logarithms and needs non-linear least squares (Real Statistics, read 2026-11-08).

Worked example with the arithmetic shown

This is an illustrative set of five made-up values, not measured data. Take x = 1, 2, 3, 4, 5 and y = 2.1, 5.8, 10.9, 16.2, 22.4. Natural logs:

x y ln x ln y (ln x)(ln y) (ln x)²
1 2.1 0.0000 0.7419 0.0000 0.0000
2 5.8 0.6931 1.7579 1.2184 0.4805
3 10.9 1.0986 2.3888 2.6244 1.2069
4 16.2 1.3863 2.7850 3.8610 1.9218
5 22.4 1.6094 3.1091 5.0037 2.5903
Sum 4.7875 10.7826 12.7075 6.1995
  1. Numerator of b: 5 × 12.7075 − 4.7875 × 10.7826 = 63.5373 − 51.6209 = 11.9164.
  2. Denominator of b: 5 × 6.1995 − 4.7875² = 30.9975 − 22.9201 = 8.0774.
  3. b = 11.9164 / 8.0774 = 1.4752.
  4. a = (10.7826 − 1.4752 × 4.7875) / 5 = (10.7826 − 7.0626) / 5 = 0.7440.
  5. A = e0.7440 = 2.104.

The fitted power curve is y = 2.104x1.475. Check: at x = 5 it predicts 2.104 × 51.475 = 22.6, close to the observed 22.4. On the log scale the line gives R² = 0.9998 for ln y; this value describes the fit to the logged data, not to y itself.

Log-scale fit versus fitting the curve directly

The log-log line minimises squared errors in ln y. Fitting y = AxB by non-linear least squares minimises squared errors in y itself, so it weights large-y points more heavily. On the five points above, direct fitting gives A ≈ 2.174 and B ≈ 1.450, against A = 2.104 and B = 1.475 from the log fit. The two answers are close here because the data hug the curve; with noisier data, or errors that grow with y, they can diverge more. State which one you used.

Interpreting the exponent b

Because y = AxB, multiplying x by a factor k multiplies y by kB. Doubling x multiplies y by 2B; in the example, 21.475 = 2.78, so doubling x raises predicted y by about 178%. This follows algebraically from the model.

Exponent Shape of y against x What the algebra says
B < 0 Decreasing, curved y falls as x rises; doubling x multiplies y by 2B, a factor below 1
0 < B < 1 Increasing, flattening doubling x multiplies y by a factor between 1 and 2
B = 1 Straight line through the origin y = Ax; doubling x doubles y
B > 1 Increasing, steepening doubling x multiplies y by more than 2

Power regression vs exponential regression

In exponential regression, y = AeBx, so ln y is linear in x itself (a semi-log plot). In power regression ln y is linear in ln x (a log-log plot). A practical check is to plot the data both ways and see which looks straight. See the guide to exponential regression for the other model, and cubic regression for a polynomial alternative. Power-law distributions are a different topic from fitting a power curve to paired data; see power law distribution.

Assumptions and common mistakes

  • Positive values only. Zeros or negatives break the logarithm. Some software adds a constant to handle zeros (the R package sars, function lin_pow, defaults to adding 1 when zeros are present, per its documentation read 2026-11-08), but that changes the model; report it if you do it.
  • Back-transforming intervals. Compute confidence or prediction limits on the log scale, then exponentiate the endpoints; do not exponentiate a standard error (Real Statistics, read 2026-11-08).
  • Judging fit on the wrong scale. Residuals and R² from the log fit describe ln y. Inspect residuals on both scales before trusting the curve.
  • Error structure. The log fit implicitly treats errors as roughly constant on the log scale (multiplicative on the original scale). If errors are additive on the original scale, consider direct non-linear fitting. See log and other data transformations.
  • Extrapolating. A power curve fitted on one range of x need not hold far outside it.

How to report power regression (APA-style example)

State the model form, the estimation method and scale, the estimates, and a fit statistic with its scale. Example wording for the worked data: “A power model, y = AxB, was fitted by ordinary least squares to the natural-log-transformed data (n = 5). The estimated exponent was B = 1.48 and the multiplier A = 2.10; R² on the log scale = .9998.” Add confidence limits for B from your software.

How to calculate power regression in Excel, R or Python

Excel

Excel has no built-in function that fits a power equation directly through TREND, GROWTH, LINEST or LOGEST; regress LN(y) on LN(x) and take the exponential of the intercept (Real Statistics, read 2026-11-08). With x in A2:A6 and y in B2:B6:

=SLOPE(LN(B2:B6), LN(A2:A6))          // b (B)
=EXP(INTERCEPT(LN(B2:B6), LN(A2:A6))) // A

In versions without dynamic arrays, enter these as array formulas.

R

x <- c(1,2,3,4,5); y <- c(2.1,5.8,10.9,16.2,22.4)
fit <- lm(log(y) ~ log(x))
b <- coef(fit)[2]; A <- exp(coef(fit)[1])
# direct non-linear fit: nls(y ~ A * x^B, start = list(A = 2, B = 1.5))

Python

import numpy as np
x = np.array([1,2,3,4,5]); y = np.array([2.1,5.8,10.9,16.2,22.4])
b, a = np.polyfit(np.log(x), np.log(y), 1)
A = np.exp(a)   # b = 1.475, A = 2.104

Frequently asked questions

What is the formula for power regression?

The model is y = Ax^B, fitted as ln y = a + b ln x, with A = e^a and B = b.

Can I use power regression with zeros or negative values?

Not directly, because the logarithm of zero or a negative number is undefined. Either use direct non-linear least squares, or document any constant you add.

Why would a spreadsheet power trendline differ from my non-linear fit?

The log-log least-squares approach minimises error on the log scale, while direct non-linear fitting minimises error on the original scale, as the worked example shows.

How do I tell power from exponential growth?

Plot ln y against ln x and against x. Whichever is closer to a straight line indicates the better-suited model.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Power Regression: Formula, Worked Example and How to Calculate It

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →