Skip to content

Invalid term in model formula with gmm after formula.tools is loaded

1 message · Elysée Aristide

#
Hi everyone,

I am using the gmm function from the gmm package and encountered an
unexpected error. No model can be estimated if I load formula.tools?I need
to restart R each time. Here is a simple reproducible example:


















*library(gmm)data(Finance)r <- Finance[1:300, 1:10]rm <- Finance[1:300,
"rm"]rf <- Finance[1:300, "rf"]z <- as.matrix(r-rf)zm <- rm-rfres <- gmm(z
~ zm, x = ~ zm)summary(res)# Now the model cannot be estimated is
formula.tools is loadedlibrary(formula.tools)res <- gmm(z ~ zm, x = ~ zm) #
invalid term in model formula# Even if I detach
detach("package:formula.tools", unload = TRUE)res <- gmm(z ~ zm, x = ~ zm)
# invalid term in model formula*

Once formula.tools is loaded in my environment, I cannot estimate any model
with the gmm function. I need to restart R each time.

Is there a way to avoid restarting R once formula.tools has been loaded?

Best,
Aristide