Open tengfei-emory opened 3 weeks ago
Hi, thanks for these really useful questions/comments!
Points 2 and 3 are now addressed by PR #79, by changing the value of coef$zero_comparison
to FALSE
in cases in which it was previously NA
.
The singular model matrix issue turns out to be a glitch from my side (there were many categorical variables and some of them completely confounded with each other). The new version addressed the problems and now the function runs without errors.
Many thanks!
That's great, thanks for following up with us!
Thanks for using the package and especially for your helpful feedback, @tengfei-emory! Keep it coming -- we welcome it! 👍
Thanks also to @svteichman for the efficient fix 🙏
@MariaAVC I think it would be great to run a check that the user hasn't input a rank-deficient X
. Teng knew exactly how to isolate the problem and why this would cause an issue (he's an expert statistician! 😻 ) but most users wouldn't! I think corncob
has such a check -- though I vaguely remember that I didn't love the specific message that was given* -- perhaps we could have one for radEmu
? Would you please be able to implement and have @svteichman and @gthopkins co-review?
Thank you all!!!
*once we settle on an error message we're happy with, let's add it to corncob, too. Happy to iterate on it (the 4 of us) over Slack.
Thanks for the continuous development of this package! I am trying to apply it to some real data and here are some issues/questions I'd like to share:
t(X) %*% X
inqr.solve()
function under theemuFit_micro()
function: when there are many categorical variables in the formula, it is possible to encounter singulart(X) %*% X
matrix. Is it ok to add a small number to the diagonal oft(X) %*% X
as an approximation of the inverse matrix?zero_comparison
column in thecoef
element of the output: apart fromTRUE
andFALSE
entries, there are alsoNA
entries which I'm not sure how to interpret. Looks like on the line 9 ofzero_comparison_check.R
, columns withcol_shared > 1
are excluded, which will exclude not only the intercept term but also categorical variables with only two levels.NA
s in thezero_comparison
column, the assignment ofind
on the line #691 ofemuFit.R
can also getNA
s, which causes error when trying to modify the corresponding p-values. I modified line #693 ascoefficients[**which(ind)**, col] <- NA
to avoid the error.