# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://excelhelp.windhamlabs.com/functions/regression-analysis/factoranalysis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
