5
$\begingroup$

The betafit package in R allows beta regressions to be fit with either a constant precision parameter (controlling the variance of the distribution about the estimated mean $\mu$) versus allowing the precision parameter to be conditional on predictors. In one analysis I obtain a log-likelihood of 10000 vs 10500 without, and with regression for precision. How do I know whether allowing the precision to vary helped?

What I am looking for is essentially something similar to whether one should choose a Poison regression or negative binomial regression, for which, one test is to use the likelihood ratios: Compare poisson and negative binomial regression with LR test

$\endgroup$

1 Answer 1

3
$\begingroup$

The likelihood ratio test applies here and is covered by the betareg vignette. The reason why it applies is that default which fixes the optimal precision parameter is equivalent to regressing the precision parameter against a constant, compare:

library(betareg)
data(GasolineYield)
gy_logit <- betareg(yield ~ batch + temp, data = GasolineYield)
gy_logit_explicit_const <- betareg(yield ~ batch + temp | 1, data = GasolineYield)
gy_logit2 <- betareg(yield ~ batch + temp | temp, data = GasolineYield)

with relevant excerpts from their summaries:

summary(gy_logit)
Phi coefficients (precision model with identity link):
      Estimate Std. Error z value   Pr(>|z|)    
(phi) 440.2784   110.0256  4.0016 6.2916e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Type of estimator: ML (maximum likelihood)
Log-likelihood: 84.79756 on 12 Df
Pseudo R-squared: 0.9617312


summary(gy_logit_explicit_const)
Phi coefficients (precision model with log link):
             Estimate Std. Error  z value   Pr(>|z|)    
(Intercept) 6.0874072  0.2499001 24.35936 < 2.22e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Type of estimator: ML (maximum likelihood)
Log-likelihood: 84.79756 on 12 Df
Pseudo R-squared: 0.9617312


summary(gy_logit2)
Phi coefficients (precision model with log link):
               Estimate  Std. Error z value   Pr(>|z|)    
(Intercept) 1.364088821 1.225781237 1.11283    0.26578    
temp        0.014570318 0.003618285 4.02686 5.6527e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
Type of estimator: ML (maximum likelihood)
Log-likelihood: 86.97707 on 13 Df
Pseudo R-squared: 0.951863

Apart from the difference in the link function there is no difference between the parameter fitted using the default arguments or supplying a constant regression term explicitly.

Thus, applying the likelihood ratio test to see whether gy_logit2 is a better fit than gy_logit:

1 - pchisq(2 * 86.98 - 2 * 84.80, 13 - 12) # 2 * diff in ll is chisq distributed

produces a p-value of 0.03679230527.

This test does not need to be done manually as one can call the lrtest function from the lmtest package, as described in the vignette:

> lmtest::lrtest(gy_logit, gy_logit2)
Likelihood ratio test

Model 1: yield ~ batch + temp
Model 2: yield ~ batch + temp | temp
  #Df    LogLik Df   Chisq Pr(>Chisq)  
1  12 84.797558                        
2  13 86.977065  1 4.35901   0.036814 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$\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.