Repository navigation
distDD: keep every bin in the table when one is dropped - #7
Open
brycewang-stanford wants to merge 1 commit into
Open
brycewang-stanford wants to merge 1 commit into
brycewang-stanford wants to merge 1 commit into
Conversation
didFF() drops bins whose influence function has close to zero variance and builds Sigmahat from the rest. The distDD table still paired all bins with diag(Sigmahat), so data.frame() stopped with "arguments imply differing number of rows" (e.g. mpdta, aggte_type = "dynamic", balance_e = 1). Report NA as the standard error of a dropped bin.
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
distDD()stops when one of the bins has a degenerate influence function and is dropped. Onmpdtathis happens withaggte_type = "dynamic"andbalance_e = 1or2.The same call without
balance_e, or withbalance_e = 0, returns six rows, anddidFF()with the same arguments runs. I see it with bothdid2.3.0 anddid2.5.1.Cause
didFF()drops bins whose influence function has close to zero variance (keep_IF) and buildsSigmahatfrom the remaining columns. ThedistDDbranch at the end still pairsbin2andpoint_estimates, which hold every bin, withsqrt(diag(Sigmahat)), which holds the kept ones. ThedidFFbranch is not affected, because its table haslevelandimplied_densityonly.Change
The table keeps one row per bin, and a dropped bin gets
NAas its standard error. In the example above the last bin is the dropped one. Its estimate is exactly zero and its standard error is nowNA:Calls where no bin is dropped return what they returned before.
NAseemed the least surprising choice to me, since the rows stay aligned with the bins. If you would rather drop the row, or report a zero, that is a one-line change and I am glad to adjust.Testing
tests/test_distDD.Ris new. It runs the example with and withoutbalance_e = 1and checks that both tables have six rows with the same levels and that exactly one standard error is missing in the second. It errors onmainand passes with this change (did2.5.1, R 4.5.2).The test passes
control_groupexplicitly, so it does not depend on #6.