where is the estimated coefficient for the independent variable, is the estimated variance of the coefficient, and FE and RE subscripts denote the values were obtained, respectively, by fixed effects and random effects estimation. The distribution of the test statistic is chi-squared with 1 degree of freedom. The general idea can be extended to models with more than one independent variable (p degrees of freedom), but that requires matrix algebra. Fortunately, STATA (and some other econometric software) allows you to perform a Hausman test without any manual calculations or matrix operations.