# Calculadora de regresión lineal

> Ajusta datos emparejados y muestra residuos y correlación.

[Open tool](https://www.toolcabana.com/es/linear-regression-calculator) · [Estadística y análisis](https://www.toolcabana.com/es/category/statistics-and-analysis)

Tool ID: linear-regression-calculator. Requested language: es. Description language: es. 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 (es)

Ajusta datos emparejados y muestra residuos y correlación.

## Steps (es)

1. Pega la fuente en el editor de entrada o carga el ejemplo integrado.
2. Comprueba el formato de origen antes de ejecutar la operación.
3. Ejecuta la calculadora de regresión lineal, revisa la salida y usa los controles disponibles para copiar o descargar.

## Settings

No additional settings.

## Limitations (es)

Cálculos locales limitados. Las entradas numéricas deben ser finitas y estar dentro de los rangos visibles. Las listas y tablas tienen límites propios de cada operación. Los modelos, estimaciones y tipos suministrados deben comprobarse según tu uso previsto.

## Example input

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

## Privacy and connections (es)

Esta operación procesa su fuente en tu navegador. Copiar y descargar son acciones explícitas; la entrada de origen no se guarda en una cuenta ni en un historial.

## Questions (es)

### 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.

### ¿Dónde se procesa mi entrada?

Esta operación procesa su fuente en tu navegador. Copiar y descargar son acciones explícitas; la entrada de origen no se guarda en una cuenta ni en un historial.

### ¿Cuáles son los límites de entrada?

Cálculos locales limitados. Las entradas numéricas deben ser finitas y estar dentro de los rangos visibles. Las listas y tablas tienen límites propios de cada operación. Los modelos, estimaciones y tipos suministrados deben comprobarse según tu uso previsto.

## Related tools

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