# Cubic Regression in Excel (Step-by-Step)

Cubic regression is a regression technique we can use when the relationship between a predictor variable and a response variable is non-linear.

The following step-by-step example shows how to fit a cubic regression model to a dataset in Excel.

### Step 1: Create the Data

First, let’s create a fake dataset in Excel: ### Step 2: Perform Cubic Regression

Next, we can use the following formula in Excel to fit a cubic regression model in Excel:

```=LINEST(B2:B13, A2:A13^{1,2,3})
```

The following screenshot shows how to perform cubic regression for our particular example: Using the coefficients in the output, we can write the following estimated regression model:

ŷ = -32.0118 + 9.832x – 0.3214x2 + 0.0033x3

### Step 3: Visualize the Cubic Regression Model

We can also create a scatterplot with the fitted regression line to visualize the cubic regression model.

First, highlight the data: Then click the Insert tab along the top ribbon and click the first option within the Insert Scatter (X, Y) option in the Charts group. This will produce the following scatterplot: Next, click the green plus sign in the top right corner of the chart and click the arrow to the right of Trendline. In the dropdown menu that appears, click More Options Next, click the Polynomial trendline option and select 3 for the order. Then check the box next to “Display Equation on chart” The following trendline and equation will appear on the chart: Notice that the equation in the chart matches the equation that we calculated using the LINEST() function.