2
$\begingroup$

I have a very simple GLM in MATLAB $$y=\beta_0+\beta_1x_1+\beta_2x_2+\epsilon,$$ which I fit with glmfit.

Now I wish to test if $\beta_1=\beta_2$ with linear hypothesis test. In MATLAB, this can be done by linhyptest.

One of the parameters requested by linhyptest is dfe -- "the degrees of freedom for the COVB estimate."

The most similar quantity output by glmfit is dfe -- "degrees of freedom for error."

Are these the same thing? If not, how may I derive the correct dfe for linhyptest?

$\endgroup$
3
  • $\begingroup$ Yes there are in this context. Having said that you appear to fit a simple linear regression model. In this case the standard regstats would do just fine and you could follow the example in the webpage directly. Is there something caveat that enforces the use of glmfit? $\endgroup$
    – usεr11852
    Commented Apr 20, 2016 at 6:38
  • $\begingroup$ @usεr11852 thanks! nothing caveat -- it's just I started off with glmfit and have generated all the results with glmfit. So the two dfe are the same? But why "the degrees of freedom for the COVB estimate" = "degrees of freedom for error"? $\endgroup$ Commented Apr 21, 2016 at 2:09
  • $\begingroup$ Yes, they are the same in the current context. The common use of degrees of freedom is in conjunction with the error. The error itself is related to the $\beta$ estimates. I guess it is a bit unfortunate use of terminology. In both case you are doing an $F$-test and get the $p$-value of the upper tail of the $F$ cumulative distribution function. That's why you provide the dfe to begin with. $\endgroup$
    – usεr11852
    Commented Apr 23, 2016 at 7:44

1 Answer 1

3
+50
$\begingroup$

As mentioned in the comments in the current context: "the degrees of freedom for the COVB estimate" and "degrees of freedom for error" refer to the same thing. It is somewhat unfortunate that the documentation of the two functions refers to the same thing with slightly different terms.

As in most cases the term "degrees of freedom" is related to the error/residuals. As this error is directly associated to the $\beta$ estimates of the model used the wording "the degrees of freedom for the COVB estimate" is valid while unfortunately slightly contrived. Nevertheless in both cases what is taking place is an $F$-test about the relevancy of the model examined. You get the associated $p$-value of the upper tail of the $F$-cumulative distribution function. This thread on the mechanics of the General linear hypothesis test statistic gives a nice theoretical overview.

In general linhyptest is a bit of a niche function. I think bootstrapping your model to get confidence intervals will be far more informative than an asymptotic test based on normality assumption for the parameter estimates. As usually an $F$-test tests the null hypothesis that all the $\beta$ is your model are equal to 0 (aside $\beta_0$); this is a more restrictive assumption and I am not sure it is terribly informative in most cases unless you start defining certain complex grouping among your covariates.

Particular to the MATLAB aspect of your question I would suggest using the standard regstats function instead of glmfit given you are not using a particular link-function for your GLM. It will be more computationally efficient as well as more straightforward to use with linhyptest.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.