Logarithmic Regression Calculator

Enter your x and y data points to fit a logarithmic regression curve of the form y = a + b·ln(x). Paste your data into the X Values and Y Values fields, and get back the regression equation, correlation coefficient (r), and R-squared value showing how well the logarithmic model fits your data.

Enter positive x values, one per line. X values must be greater than 0 for logarithmic regression.

Enter corresponding y values, one per line. Must match the number of x values.

Results

Regression Equation

--

Coefficient a

--

Coefficient b

--

Correlation Coefficient (r)

--

R-Squared (R²)

--

Sample Size (n)

--

Data Points vs. Logarithmic Fit

Results Table

Frequently Asked Questions

What is logarithmic regression?

Logarithmic regression is a type of regression analysis where the relationship between the independent variable x and the dependent variable y is modeled using the equation y = a + b·ln(x). It is appropriate when data grows or declines rapidly at first and then levels off over time.

What does the equation y = a + b·ln(x) mean?

In the logarithmic model, 'a' is the y-intercept and 'b' is the coefficient that controls the rate of growth or decay. ln(x) is the natural logarithm of x. A positive 'b' means y increases as x increases, while a negative 'b' means y decreases.

Why must x values be positive for logarithmic regression?

The natural logarithm ln(x) is only defined for positive real numbers. If any x value is zero or negative, the logarithm is undefined, and the regression cannot be computed. All x values must be strictly greater than zero.

What does R-squared (R²) tell me about my data?

R-squared measures how well the logarithmic model explains the variation in your y data. Values range from 0 to 1, where 1 means a perfect fit and 0 means the model explains none of the variation. An R² above 0.90 generally indicates a strong fit.

What is the correlation coefficient r, and how is it different from R²?

The correlation coefficient r measures the strength and direction of the relationship between ln(x) and y, ranging from -1 to +1. R-squared is simply r squared, representing the proportion of variance in y explained by the model. Both provide complementary information about fit quality.

What are residuals in regression analysis?

A residual is the difference between an observed y value and the predicted ŷ value from the regression equation (y − ŷ). Small residuals indicate that the model fits the data well. Examining residuals helps identify patterns that suggest the logarithmic model may or may not be appropriate.

How many data points do I need for logarithmic regression?

You need at least 3 data points to compute a meaningful logarithmic regression, since the model has two parameters (a and b). In practice, more data points (10 or more) lead to more reliable and stable results.

When should I use logarithmic regression instead of linear or polynomial regression?

Use logarithmic regression when your data shows rapid change early on that gradually levels off — for example, population growth, learning curves, or diminishing returns. If a scatter plot of ln(x) vs. y appears roughly linear, logarithmic regression is a good choice.

More Statistics Tools