Analyze comparative data using covariance matrices and predictors. Generate exports, residual checks, and confidence details. Built for careful evolutionary regression work across structured datasets.
| Observation | BodyMass | Temperature | Trait Response |
|---|---|---|---|
| 1 | 3.1 | 20 | 12.1 |
| 2 | 3.8 | 22 | 14.0 |
| 3 | 4.2 | 25 | 15.3 |
| 4 | 4.9 | 26 | 16.8 |
| 5 | 5.5 | 29 | 18.2 |
PGLS coefficient estimate: β = (XTV-1X)-1XTV-1y
Residual variance: σ2 = eTV-1e / (n - p)
Coefficient variance: Var(β) = σ2(XTV-1X)-1
Confidence interval: estimate ± z1-α/2 × standard error
This file uses normal-based z inference for quick interpretation. The lambda option scales off-diagonal covariance terms, while diagonal variances remain unchanged.
Phylogenetic generalized least squares, or PGLS, extends linear regression for comparative biology. It handles trait data that share evolutionary history. Related species often resemble each other. Ordinary least squares ignores that dependence. PGLS models it directly.
Species are not statistically independent. Close relatives may have similar body size, metabolism, or behavior because of shared ancestry. A phylogenetic covariance matrix represents that expected similarity. PGLS uses this matrix while estimating regression coefficients. The result is a better estimate of slopes, standard errors, and confidence intervals.
This calculator accepts a response vector, predictor matrix, and phylogenetic covariance matrix. It then estimates coefficients with generalized least squares. It reports fitted values, residuals, standard errors, z scores, p values, confidence intervals, and model fit measures. It also applies an optional lambda transformation. That helps users test weaker or stronger phylogenetic correlation patterns.
The core estimate is beta equals inverse of X transpose V inverse X, multiplied by X transpose V inverse y. Here, X is the design matrix. V is the phylogenetic covariance matrix. y is the response vector. Residual variance and coefficient uncertainty are then derived from the weighted residual structure. These steps follow the standard GLS framework used in comparative statistics.
Use this calculator when your observations are species, strains, lineages, or other related units. It is useful for testing whether ecological, morphological, or environmental predictors explain a trait after accounting for shared ancestry. It is also helpful for teaching, sensitivity checks, and quick model reviews before moving into larger workflows.
A positive coefficient suggests the predictor increases the expected response, after accounting for phylogenetic dependence. Wide intervals suggest uncertainty. Large residual patterns may indicate missing predictors or covariance misspecification. Always verify that the covariance matrix is square, symmetric, and biologically sensible. Good inputs produce more meaningful comparative inferences.
Because results depend on matrix quality, check row order carefully. Response values, predictor rows, and covariance rows must match exactly. Small sample sizes can produce unstable estimates. Compare models, inspect residuals, and document your biological assumptions before drawing strong evolutionary conclusions from these outputs.
PGLS is a regression method for related observations. It uses a covariance matrix that represents shared ancestry. This adjusts coefficient estimates and standard errors when species are not independent.
You need a response vector, predictor names, predictor rows, and a square covariance matrix. Each row must describe the same observation order across every input block.
No. It uses the covariance matrix you provide. Build that matrix from your phylogeny elsewhere, then paste it here for regression, diagnostics, and exportable summaries.
Lambda scales off-diagonal covariance values. A value near zero reduces phylogenetic dependence. A value near one keeps the original covariance structure largely intact.
This version uses normal-based inference for quick interpretation. That works well for many teaching and screening tasks, but specialized software can offer richer hypothesis testing.
Yes. Add predictor names separated by commas. Then enter matching data rows with one observation per line and one value per predictor column.
It must be square, symmetric, and aligned to the same observation order. It also needs to be invertible after any lambda adjustment. Otherwise the model cannot be estimated.
Use dedicated comparative packages when you need tree estimation, branch-length optimization, model comparison across many structures, or publication-grade workflows with extensive diagnostics.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.