I have a longitudinal dataset and I am trying to create two variables that correspond to two time periods based on specific date ranges (pre- and post-) to be able to analyze the effect of each of those time periods on my outcome. However, when I tried to create these time period variables as exposures to use with my outcome using logistic regression, I get this error message "outcome = variable_name > 0 predicts data perfectly."
This is how I created my time period variables:
**Period 1:** bysort id_variable: gen pre-period = binary_outcome if (date_of_eval < mdy(5,4,2020))
**Period 2** bysort id_variable: gen post-period = binary_outcome if (date_of_eval > mdy(5,4,2020))
Does anyone know what this error code means or if I have incorrectly coded my variables?
Thank you!