|
Daniel wrote:
> I am trying to decipher the statistics returned by glmfit.
>
> If I take the fit parameter returned and divide it by the sqrt of the covariance returned for that same parameter, I get a number that equals the t statistic returned. This leads to my first question, which is shouldn't I also have to normalize by the sqrt of n, which n is the number of samples? (Or is n somehow equal to 1 for this fit?)
That cov matrix is an estimate of the covariance of the parameter estimates (estimators, technically), so the number of observations is already figured in. In a simpler context, where x is just a vector of data drawn from a normal dist'n, it's like the difference between std(x), which is an estimate of the population std dev sigma, and std(x)/sqrt(length(x)), which is the std error of muHat = mean(x), i.e. an estimate of the variance of muHat.
> My second question is that when I work with the t-value returned, I cannot figure out how the p-value is calculated. I am assuming that the hypothesis being tested is the fit parameters returned are equal to zero. But I cannot find a value for the degrees of freedom that will yield the p-values returned given the t-values returned.
It's a two-tailed p-value, and the degrees of freedom is given by the dfe field of that same structure. In this case, dfe is (number of observations) - (number of estimated regression coefs).
> Hope that this makes sense. I am probably just missing something simple.
Often the best way to sort this out is to just step through the code in the debugger.
|