[R-meta] Wald_test error

James Pustejovsky jepu@to @end|ng |rom gm@||@com
Fri Aug 13 16:25:13 CEST 2021


Hi Catia,

Version 0.5.0 of clubSandwich introduced a new syntax for the Wald_test()
function, which is why you’re getting this error. To fix the error, you’ll
need to use the new constrain_zero() or constrain_equal() functions in the
constraints argument of Wald_test(). Based on the example you gave, the new
syntax would be:

Wald_test(m3_robu, constraints = constrain_zero(10:12), vcov = "CR2")
Wald_test(m3_metafor, constraints = constrain_zero(10:12), vcov = "CR2")

For further details, please have a look at the package vignette on Wald
tests:
https://cran.r-project.org/web/packages/clubSandwich/vignettes/Wald-tests-in-clubSandwich.html

Kind Regards,
James

On Tue, Aug 10, 2021 at 6:40 AM Cátia Ferreira De Oliveira <
cmfo500 using york.ac.uk> wrote:

> Dear all,
>
> I have tried to run the code in this post:
> https://www.jepusto.com/clubsandwich-for-rve-meta-analysis/
>
> *options(width=150)*
> *library(robumeta)*
> *library(clubSandwich)*
>
>
> *data(dropoutPrevention)*
>
>
>
> *m3_robu <- robu(LOR1 ~ study_design + attrition + group_equivalence +
> adjusted*
> *                + outcome + evaluator_independence*
> *                + male_pct + white_pct + average_age*
> *                + implementation_quality + program_site + duration +
> service_hrs, *
> *                data = dropoutPrevention, studynum = studyID, var.eff.size
> = varLOR, *
> *                modelweights = "HIER")*
> *print(m3_robu)*
>
>
> *Wald_test(m3_robu, constraints = 10:12, vcov = "CR2")*
>
>
> But it gives me the following error when I run the Wald_test:
>
>
>
> *Error in if (!inherits(constraints, "matrix") | ncol(constraints) != p) {
> :   argument is of length zero*
>
> Does anyone know why this is happening?
>
> Best wishes,
>
> Catia
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-meta-analysis mailing list
> R-sig-meta-analysis using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
>

	[[alternative HTML version deleted]]



More information about the R-sig-meta-analysis mailing list