Closed moritzpschwarz closed 2 years ago
Yep, my code snippet is still required because your proportion and distortion tests only apply in the OLS case. The same code snippet seems to still work (without it, I get more failures of my unit tests) but even when I add it, I still get failures of other unit tests. So if it's fine with you, I will check it in more detail before confirming this review. It's probably just because we now have the additional getsis$aux$args
but I'd like to make sure that it's nothing serious.
Yep, my code snippet is still required
Excellent, thanks for the quick review. I've now added it again.
So if it's fine with you, I will check it in more detail before confirming this review. It's probably just because we now have the additional
getsis$aux$args
but I'd like to make sure that it's nothing serious.
Of course, take your time!!
For me, the code does break some of my unit tests, other than just having the new output element getsis$aux$args
.
When I call isat()
from within my ivgets::ivisat()
function, I get an error in line 56 when the list isat.args
is created. The error message says "object t.pval not found"
. This is a bit of a mystery for me. Stepping into the function call before the error occurs, I see that t.pval
exists in the environment but as a promise. The reason is that I am not specifying the argument t.pval
in isat.default()
explicitly but by passing the argument t.pval
from ivgets::ivisat()
to isat
. This should not be a problem. The promise should simply be evaluated once it is used. For example, in the current version of isat.default()
, I do not get any error messages even though it also uses the promise t.pval
in later function calls.
I have also modified isat.default()
with a simple line of code t.pval
before line 56. Strangely enough, this does not raise an error. To be clear, the way I modified isat.default()
is as follows:
t.pval
isat.args <- list(
mc = mc,
ar = ar,
# and so on
max.block.size = max.block.size,
t.pval = t.pval,
wald.pval = wald.pval,
# and so on
)
The first line t.pval
runs without error (and simply prints t.pval
to the console) but the next line raises the error "object t.pval not found"
. I'm puzzled.
Okay, found the problem! I now have new branches for the ivgets and robust2sls packages that are compatible with this branch of gets. So once gets is updated to this new version, I can release or at least offer new, compatible versions accordingly.
This aims to deal with the multiple issues introduced by relying on the
Sys.call()
argument.At the moment, this is only used explicitly in the part determining whether to carry out Outlier Distortion.
Motivating Error
Here is an example of the error:
Solution Approach
I now don't rely on the
Sys.call()
argument anymore. Rather I'm creating a new list object calledisat.args
that is subsequently saved ingetsis$aux$args
.This means that we can convert this:
To this:
Essential is for me that @jkurle checks if this works with his package. I think you added this fix here:
!identical(userEstArg$name, "ols")
- do we need this again? Happy to add in that case.I'm also fixing an error that was raised by F-bear in 2020. The error was like this:
This used to fail as a data.frame was not treated the same as a matrix - a data.frame used to be broken up by column and each column was turned into a list. Now a data.frame is treated like a matrix.