I need to replicate a paper published in a top journal in my field that is well cited but that has an unusual setup/research design.
Usually, one wants to avoid a logit regression where the dependent variable is always 1, because if one had a constant variable one could easily perfectly predict the data.
The authors of the paper mechanically set the dependent variable to always be 1, while making sure that there is no constant or other variable(s) with which the constant dependent variable can be perfectly predicted.
Is there a way for me to replicate this setting in Stata? The problem seems to be that Stata is not willing to run a logit regression if the dependent variable is always 1, even if the dependent variable cannot be perfectly predicted with the independent variables since Stata always seems to provide an error message when the dependent variable is always 1 in a logit regression. Since I need to replicate the paper, I need to stick to this unfortunate setting.
As an example dataset
var1 var2
1 0
1 1
1 0
I run: logit var1 var2, nocons
Usually, one wants to avoid a logit regression where the dependent variable is always 1, because if one had a constant variable one could easily perfectly predict the data.
The authors of the paper mechanically set the dependent variable to always be 1, while making sure that there is no constant or other variable(s) with which the constant dependent variable can be perfectly predicted.
Is there a way for me to replicate this setting in Stata? The problem seems to be that Stata is not willing to run a logit regression if the dependent variable is always 1, even if the dependent variable cannot be perfectly predicted with the independent variables since Stata always seems to provide an error message when the dependent variable is always 1 in a logit regression. Since I need to replicate the paper, I need to stick to this unfortunate setting.
As an example dataset
var1 var2
1 0
1 1
1 0
I run: logit var1 var2, nocons
Comment