# Calculadora de regressão linear

> Ajusta dados emparelhados e mostra resíduos e correlação.

[Open tool](https://www.toolcabana.com/pt-br/linear-regression-calculator) · [Estatística e análise](https://www.toolcabana.com/pt-br/category/statistics-and-analysis)

Tool ID: linear-regression-calculator. Requested language: pt-BR. Description language: pt-BR. Complete guide translation: yes.

## Overview (en)

The Linear regression calculator fits a least-squares line to x,y pairs entered one per line and returns the slope, intercept, Pearson correlation and R². A residual table lists each observed y, the predicted y from the fitted line and the difference between them. At least 3 pairs are required, and up to 500 lines are accepted.

## Supported tasks (pt-BR)

Ajusta dados emparelhados e mostra resíduos e correlação.

## Steps (pt-BR)

1. Cole a fonte no editor de entrada ou carregue o exemplo integrado.
2. Verifique o formato de origem antes de executar a operação.
3. Execute a calculadora de regressão linear, revise a saída e use os controles disponíveis para copiar ou baixar.

## Settings

No additional settings.

## Limitations (pt-BR)

Cálculos locais limitados. As entradas numéricas devem ser finitas e estar dentro dos intervalos visíveis. Listas e tabelas têm limites próprios de cada operação. Modelos, estimativas e taxas fornecidas devem ser verificados conforme seu uso pretendido.

## Example input

```text
1,2
2,4
3,5
4,8
```

## Privacy and connections (pt-BR)

Esta operação processa sua fonte no seu navegador. Copiar e baixar são ações explícitas; a entrada de origem não é salva em conta nem em histórico.

## Questions (pt-BR)

### How are the slope and intercept calculated?

The calculator uses ordinary least squares. The slope is the sum of (x − mean x)(y − mean y) divided by the sum of (x − mean x)², and the intercept is mean y − slope × mean x, so the line is y = intercept + slope × x.

### What do correlation and R² tell me?

Correlation r ranges from −1 to 1 and shows the direction and strength of the linear relationship. R² is r squared and gives the share of variation in y explained by the line. Both are reported as undefined when every y value is the same.

### Why does the regression calculator say x values need variation?

If every x value is identical, the line's slope cannot be determined because the denominator becomes zero. Enter pairs with at least two different x values, and use a comma between x and y on each line.

### Onde minha entrada é processada?

Esta operação processa sua fonte no seu navegador. Copiar e baixar são ações explícitas; a entrada de origem não é salva em conta nem em histórico.

### Quais são os limites de entrada?

Cálculos locais limitados. As entradas numéricas devem ser finitas e estar dentro dos intervalos visíveis. Listas e tabelas têm limites próprios de cada operação. Modelos, estimativas e taxas fornecidas devem ser verificados conforme seu uso pretendido.

## Related tools

- [Descriptive statistics calculator](https://www.toolcabana.com/pt-br/descriptive-statistics-calculator)
- [Confidence interval calculator](https://www.toolcabana.com/pt-br/confidence-interval-calculator)
- [Sample size calculator](https://www.toolcabana.com/pt-br/sample-size-calculator)
- [Probability distribution explorer](https://www.toolcabana.com/pt-br/probability-distribution-explorer)
