Statistical Methods
Check a projection using a perpendicular residual
Define the task
A projection onto a specified direction answers how much of a vector lies along that direction. Match the coordinate order and units first. A projection in unstandardized coordinates can be dominated by variables measured on large scales. Document any centering or scaling before treating the geometry as meaningful.
Carry out the check
For a nonzero direction u and vector v, the projection is u times (u dot v)/(u dot u). Subtract the projection from v to obtain the residual. The residual should have dot product zero with u within numerical tolerance. Multiplying u by a nonzero constant changes its coefficient but leaves the projected vector unchanged.
Worked hypothetical example
For hypothetical u=(1,2) and v=(4,3), the cross-product is 10 and u dot u is 5. The coefficient is 2, the projected vector is (2,4), and the residual is (2,−1). Its dot product with u is 2−2=0. This is a geometric calculation without an intercept. It does not establish a causal effect or provide a regression uncertainty estimate.
Method checked 12 November 2026 against R documentation: Matrix Cross-Product.