-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR for #170: let the window option choose a window range #178
PR for #170: let the window option choose a window range #178
Conversation
This reverts commit c6d98aa.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@jorpppp
I tested it and I got the error message. The error comes from this line xtevent/xtevent/_eventgenvars.ado Line 454 in 8409db7
xtevent/xtevent/_eventgenvars.ado Line 430 in 8409db7
|
@Constantino-Carreto-Romero let me make a minor change to it in a push. After that I'll test the code a bit more and if it's ok I'll merge the PR.
@Constantino-Carreto-Romero Yes, please open a new issue for this. |
@Constantino-Carreto-Romero We still have bugs in this. With the example31 data:
returns an error message. I presume
Can you check this please? |
@jorpppp
I get the following outcome. |
@Constantino-Carreto-Romero did not get the error because he wasn't trying to plot. Strictly speaking the error message appears with
In any case there is a bug because the calculated window is not taking the missing values of the control variables into account, but it should. The issue has to do with the way samples are marked throughout: |
@jorpppp
examples: Line 78 in 97dff85
|
Thanks @Constantino-Carreto-Romero . This approach works but has a slight disadvantage. So instead of passing the varlist to |
@jorpppp |
When running
There is a bug because we get a calculated left endpoint of -19, but the computation of the differences of averages only includes until coefficient -9. |
…ps://github.com/JMSLab/xtevent into 170-let-the-window-option-choose-a-window-range
* #181 Fix check for constant treatment value and add returns (#182) * 186 error when normalizing 0 coefficient (#187) * #186 Fix bug when normalizing to 0 or positive * #186 Propagate the fix to _eventiv * PR for #170: let the window option choose a window range (#178) * #170 bring changes from main * #170 implement finding max or balanced window * #170 examples to test implementation * #170 add examples to test file * #170 change window description and add example in help file * #170 wording of calculated-window message * #170 modify description of left and right window * #170 wording of window limits * #170 wording of calculated-window message * #170 check for zero words in window * #170 rearrange parsewindow checks * #170 wording of window-parser error messges * #170 add to help file example about maximum window * #170 conflict with static * "#170 revert previous commit" This reverts commit c6d98aa. * #170 parse window only when it is non-empty * #170 window in cmdline parser * #170 Delete issue170 special directory * #170 wording of string window message * #170 let max or balanced only if impute is specified * #170 wording of error message * #170 restructure checks for staggered adoption * #170 restructure for IV case * #170 informative window message and error message for balanced * "#170 revert previous commit" This reverts commit fc197a9. * #170 informative window message and error message for balanced * #170 paragraph for max balanced * #170 check trend outside window for max and balanced * #170 remove comment * #170 trend specification if window is max or balanced * #170 clear message about treatment time * #170 check leads in proxyiv are in estimation window * #170 wording of message about calculated window * #178 Minor change to calculated window message * #170 mark non-missing obs in varlist * #170 examples to test implementation * #170 pass marker and revert syntax of eventgenvars * #170 Add marked sample to variables to keep when repeatedcs * #170 Delete issue170 directory * #178 Edits to helpfile --------- Co-authored-by: jorpppp <jorpppp@gmail.com> * PR for #179 Check behavior of the cohort and control_cohort options and allow automatic generation (#185) * #179 Create cohort_consistency.do * #179 Add consistency checks between cohort, control_cohort, and policyvar, add basic cohort variable creation * #179 Change cohort, control_cohort to string in xtevent * #179 Add bin and no reversion returns to _eventgenvars plus changes from #181 * #179 Enable saving created cohort variable * #179 Automatic generation of control_cohort * #179 Update help file * #179 Modify test file * #179 Delete issue folder * #179 #185 Generate cohort in sample that ignores missings in control vars * #179 #185 Add checks for existing cohort variables * #179 #185 SA and proxy not allowed * #179 #185 Fix bug in naming saved interaction variables * #179 #185 Fix sorting bug when creating cohorts in repeatedcs setting * PR for: #189 pre and post coefficients excluding omitted ones (#190) * #189 pre and post coefficients excluding omitted ones * #189 #190 enable diff avg in _eventiv * #189 #190 exclude endpoints from diffavg when trend is active --------- Co-authored-by: jorpppp <jorpppp@gmail.com> * 188 left window of zero returns an error (#194) * #188 ordering when there are not pre-event dummies * #188 ordering the left endpoint * #188 Do not test for pretrends for plot if left window is zero * #188 #194 Disable smoothest path if left window * PR for: #189 pre and post coefficients excluding omitted ones (#190) (#195) * #189 pre and post coefficients excluding omitted ones * #189 #190 enable diff avg in _eventiv * #189 #190 exclude endpoints from diffavg when trend is active --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com> * #188 #194 Fix error messages for diffavg when windows are zero * #188 #194 Fix lead selection and normalization when left window is zero or when many coefs are normalized * #188 #194 Recheck that lead instrument is in estimation window when it is changed because normalizations coincide * #188 #194 Do not test linear pretrend if too few pre-event coefs --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com> --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com>
* Bring #177 up to date again (#198) * #181 Fix check for constant treatment value and add returns (#182) * 186 error when normalizing 0 coefficient (#187) * #186 Fix bug when normalizing to 0 or positive * #186 Propagate the fix to _eventiv * PR for #170: let the window option choose a window range (#178) * #170 bring changes from main * #170 implement finding max or balanced window * #170 examples to test implementation * #170 add examples to test file * #170 change window description and add example in help file * #170 wording of calculated-window message * #170 modify description of left and right window * #170 wording of window limits * #170 wording of calculated-window message * #170 check for zero words in window * #170 rearrange parsewindow checks * #170 wording of window-parser error messges * #170 add to help file example about maximum window * #170 conflict with static * "#170 revert previous commit" This reverts commit c6d98aa. * #170 parse window only when it is non-empty * #170 window in cmdline parser * #170 Delete issue170 special directory * #170 wording of string window message * #170 let max or balanced only if impute is specified * #170 wording of error message * #170 restructure checks for staggered adoption * #170 restructure for IV case * #170 informative window message and error message for balanced * "#170 revert previous commit" This reverts commit fc197a9. * #170 informative window message and error message for balanced * #170 paragraph for max balanced * #170 check trend outside window for max and balanced * #170 remove comment * #170 trend specification if window is max or balanced * #170 clear message about treatment time * #170 check leads in proxyiv are in estimation window * #170 wording of message about calculated window * #178 Minor change to calculated window message * #170 mark non-missing obs in varlist * #170 examples to test implementation * #170 pass marker and revert syntax of eventgenvars * #170 Add marked sample to variables to keep when repeatedcs * #170 Delete issue170 directory * #178 Edits to helpfile --------- Co-authored-by: jorpppp <jorpppp@gmail.com> * PR for #179 Check behavior of the cohort and control_cohort options and allow automatic generation (#185) * #179 Create cohort_consistency.do * #179 Add consistency checks between cohort, control_cohort, and policyvar, add basic cohort variable creation * #179 Change cohort, control_cohort to string in xtevent * #179 Add bin and no reversion returns to _eventgenvars plus changes from #181 * #179 Enable saving created cohort variable * #179 Automatic generation of control_cohort * #179 Update help file * #179 Modify test file * #179 Delete issue folder * #179 #185 Generate cohort in sample that ignores missings in control vars * #179 #185 Add checks for existing cohort variables * #179 #185 SA and proxy not allowed * #179 #185 Fix bug in naming saved interaction variables * #179 #185 Fix sorting bug when creating cohorts in repeatedcs setting * PR for: #189 pre and post coefficients excluding omitted ones (#190) * #189 pre and post coefficients excluding omitted ones * #189 #190 enable diff avg in _eventiv * #189 #190 exclude endpoints from diffavg when trend is active --------- Co-authored-by: jorpppp <jorpppp@gmail.com> * 188 left window of zero returns an error (#194) * #188 ordering when there are not pre-event dummies * #188 ordering the left endpoint * #188 Do not test for pretrends for plot if left window is zero * #188 #194 Disable smoothest path if left window * PR for: #189 pre and post coefficients excluding omitted ones (#190) (#195) * #189 pre and post coefficients excluding omitted ones * #189 #190 enable diff avg in _eventiv * #189 #190 exclude endpoints from diffavg when trend is active --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com> * #188 #194 Fix error messages for diffavg when windows are zero * #188 #194 Fix lead selection and normalization when left window is zero or when many coefs are normalized * #188 #194 Recheck that lead instrument is in estimation window when it is changed because normalizations coincide * #188 #194 Do not test linear pretrend if too few pre-event coefs --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com> --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com> * Delete issue177 directory * Revert "Delete issue177 directory" This reverts commit 5c18688. * Revert "Bring #177 up to date again (#198)" This reverts commit 50b9efc. --------- Co-authored-by: Constantino Carreto Romero <carretoromeroc@gmail.com>
Closes #170