Displaying 1 result from an estimated 1 matches for "_kk".
Did you mean:
_k
2011 Aug 01
3
formula used by R to compute the t-values in a linear regression
...unction lm to compute the t-values.
I am trying to implement a linear regression myself. Assuming that I have K variables, and N observations, the formula I am using is:
For the k-th variable, t-value= b_k/sigma_k
With b_k is the coefficient for the k-th variable, and sigma_k =(t(x) x )^(-1) _kk is its standard deviation.
I find sigma_k = sigma * n/(n*Sum x_{k,i}^2 -(sum x_{k,i}^2))
With sigma: the estimated standard deviation of the residuals,
Sigma = sqrt(1/(N-K-1)*Sum epsilon_i^2)
With:
N: number of observations
K: number of variables
This formula comes from my old course...