waldtypetest provides Wald-type tests for both simple and composite hypotheses for beta regression based on the robust estimators (LSMLE, LMDPDE, SMLE, and MDPDE).
waldtypetest(object, FUN,...)
Arguments
object: fitted model object of class robustbetareg (see robustbetareg).
FUN: function representing the null hypothesis to be tested.
...: further arguments to be passed to the FUN function.
Returns
waldtypetest returns an output for the Wald-type test containing the value of the test statistic, degrees-of-freedom and p-value.
Details
The function provides a robust Wald-type test for a general hypothesis m(θ)=η0, for a fixed η0∈Rd, against a two sided alternative; see Maluf et al. (2022) for details. The argument FUN specifies the function m(θ)−η0, which defines the null hypothesis. For instance, consider a model with θ=(β1,β2,β3,γ1)⊤ and let the null hypothesis be β2+β3=4. The FUN argument can be FUN = function(theta) {theta[2] + theta[3] - 4}. It is also possible to define the function as FUN = function(theta, B) {theta[2] + theta[3] - B}, and pass the B argument through the waldtypetest function. If no function is specified, that is, FUN=NULL, the waldtypetest
returns a test in which the null hypothesis is that all the coefficients are zero.
Examples
# generating a datasetset.seed(2022)n <-40beta.coef <- c(-1,-2)gamma.coef <- c(5)X <- cbind(rep(1, n), x <- runif(n))mu <- exp(X%*%beta.coef)/(1+ exp(X%*%beta.coef))phi <- exp(gamma.coef)#Inverse Log Link Functiony <- rbeta(n, mu*phi,(1- mu)*phi)y[26]<- rbeta(1,((1+ mu[26])/2)*phi,(1-((1+ mu[26])/2))*phi)SimData <- as.data.frame(cbind(y, x))colnames(SimData)<- c("y","x")# Fitting the MLE and the LSMLEfit.mle <- robustbetareg(y ~ x |1, data = SimData, alpha =0)fit.lsmle <- robustbetareg(y ~ x |1, data = SimData)# Hypothesis to be tested: (beta_1, beta_2) = c(-1, -2) against a two# sided alternativeh0 <-function(theta){theta[1:2]- c(-1,-2)}waldtypetest(fit.mle, h0)waldtypetest(fit.lsmle, h0)# Alternative way:h0 <-function(theta, B){theta[1:2]- B}waldtypetest(fit.mle, h0, B = c(-1,-2))waldtypetest(fit.lsmle, h0, B = c(-1,-2))
References
Maluf, Y. S., Ferrari, S. L. P., and Queiroz, F. F. (2022). Robust beta regression through the logit transformation. arXiv:2209.11315.
Basu, A., Ghosh, A., Martin, N., and Pardo, L. (2018). Robust Wald-type tests for non-homogeneous observations based on the minimum density power divergence estimator. Metrika, 81:493–522.
Ribeiro, K. A. T. and Ferrari, S. L. P. (2022). Robust estimation in beta regression via maximum Lq-likelihood. Statistical Papers.