# 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

![](https://258561627-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MK66-MGuoULhqCDXLwy%2F-MLEfc3X88qo0AJvS7LI%2F-MLEfv67tUTz3h9E5Fx2%2Fimage.png?alt=media\&token=c10169b0-b41f-46bb-a5ab-56768374c374)

{% file src="<https://258561627-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MK66-MGuoULhqCDXLwy%2F-MQVAcWe4fhnIonFtDyK%2F-MLEg525gUpFwqubyLYm%2FFACTORANALYSIS.xlsx?alt=media&token=a435b06d-47b7-4e2d-95e2-e900dfc84b90>" %}
Example Workbook: FACTORANALYSIS
{% endfile %}
