> For the complete documentation index, see [llms.txt](https://excelhelp.windhamlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://excelhelp.windhamlabs.com/functions/regression-analysis/factoranalysis.md).

# FACTORANALYSIS

## Description

Multi-factor and stepwise regression model to identify the sensitivity of an asset, manager, or portfolio's return against a set of factors.

## Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

```excel-formula
=FACTORANALYSIS(whichStat, y, x, isStepwise)
```

### Input(s)

| Argument       | Description                                                                                                                                                                                                                                                                                             |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **whichStat**  | <p>Required. String to specify statistic to return, use one of the following options:<br>   "beta"</p><p>   "intercept"</p><p>   "rsquared"</p><p>   "tstat"</p><p>   "tintercept"</p><p>   "residualvariance"</p><p>   "totalvariance"</p><p>   "riskdecomposition"</p><p>   "returndecomposition"</p> |
| **y**          | Required. Time series or matrix of dependent variables. This is typically the time series of your portfolios, managers, or asset class returns.                                                                                                                                                         |
| **x**          | Required. Time series or matrix of independent variables. This is typically a set of economic variables or factors.                                                                                                                                                                                     |
| **isStepwise** | Optional. Logical (TRUE or FALSE). If TRUE then a stepwise regression algorithm is used, if the argument is not specified it defaults to FALSE.                                                                                                                                                         |

### Output(s)

The function's output will vary depending on the specification of the `whichStat` argument. The following table will describe the corresponding output result. For M-dependent variables (y) and N-independent variables (x)

| whichStat               | Output                                                           |
| ----------------------- | ---------------------------------------------------------------- |
| **beta**                | NxM regression coefficients.                                     |
| **intercept**           | 1xN intercept values.                                            |
| **rsquared**            | 1xN coefficient of determination, or$$R^2$$ values.              |
| **tstat**               | MxN t-statistics.                                                |
| **tintercept**          | 1xN t-statistic of the intercepts.                               |
| **residualvariance**    | 1xN residual variance.                                           |
| **totalvariance**       | Total variance of the regression.                                |
| **riskdecomposition**   | MxN risk decomposition of y as a function of x and residuals.    |
| **returndecomposition** | MxN return decomposition of y as a function of x and intercepts. |

## Example

![](/files/-MLEfv67tUTz3h9E5Fx2)

{% file src="/files/-MLEg525gUpFwqubyLYm" %}
Example Workbook: FACTORANALYSIS
{% endfile %}
