Hi everybody,
i am currently working on my masterthesis and do need some help.
To summarize my situation:
I want to analyse the effects of an divorce on happiness. As i wanted to define the treatment variables for a divorce, i got confused on how to handle the following situation:
In the dataset there are 2 variables relevant for that situation.
- "partner" - which is binary variable (which is basically 1 if you have partner and 0 if you are single)
- "partnr" - which is either a positive number or takes on the negative value of (-2)
Whenever the "partnr" takes on a positive value, "Partner" will take on the Value 1. Otherwise the person will be considered as "Single"
This is my command for defining the treatment : "separtion from partner in the second year"
After i use some command to restrict the sample (eliminating obervations with specific age etc.) i ran count if sep==1
and i also ran the command
count if (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==1 & f2.partnr!=partnr) | (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==0 & f2.partnr!=partnr)
Both of those commands generate a different output and my question is: Shouldn't both commands give me the same amount of obersvations since it is the same condition? (especially after restricting the sample)
I hope that i asked in an understandable way.
Thank you very much in advance.
i am currently working on my masterthesis and do need some help.
To summarize my situation:
I want to analyse the effects of an divorce on happiness. As i wanted to define the treatment variables for a divorce, i got confused on how to handle the following situation:
In the dataset there are 2 variables relevant for that situation.
- "partner" - which is binary variable (which is basically 1 if you have partner and 0 if you are single)
- "partnr" - which is either a positive number or takes on the negative value of (-2)
Whenever the "partnr" takes on a positive value, "Partner" will take on the Value 1. Otherwise the person will be considered as "Single"
This is my command for defining the treatment : "separtion from partner in the second year"
Code:
gen sep=1 if (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==1 & f2.partnr!=partnr) | /// (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==0 & f2.partnr!=partnr) replace sep=0 if (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==1 & f2.partnr==partnr) | /// (partner==1 & (f1.partner==1) & f1.partnr!=partnr & f2.partner==1 & f2.partnr==partnr) | /// (partner==1 & (f1.partner==1) & f1.partnr!=partnr & f2.partner==1 & f2.partnr!=partnr) | /// (partner==1 & (f1.partner==1) & f1.partnr!=partnr & f2.partner==0 & f2.partnr!=partnr) | /// (partner==1 & (f1.partner==0) & f1.partnr!=partnr & f2.partner==1 & f2.partnr==partnr) | /// (partner==1 & (f1.partner==0) & f1.partnr!=partnr & f2.partner==1 & f2.partnr!=partnr) | /// (partner==1 & (f1.partner==0) & f1.partnr!=partnr & f2.partner==0 & f2.partnr!=partnr)
and i also ran the command
count if (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==1 & f2.partnr!=partnr) | (partner==1 & (f1.partner==1) & f1.partnr==partnr & f2.partner==0 & f2.partnr!=partnr)
Both of those commands generate a different output and my question is: Shouldn't both commands give me the same amount of obersvations since it is the same condition? (especially after restricting the sample)
I hope that i asked in an understandable way.
Thank you very much in advance.
Comment