I am working with dates of birth of children before the mothers are diagnosed with a disease. In a wide format each consecutive birthdate are numberad parity1 to parityx. I use inrange to identify the number of births before the diagnosis
unab Pari: Parity*
local N: word count `Pari'
gen Parity_at_baseline=0
forv i=1/`N'{
replace Parity_at_baseline=Parity`i' if inrange(birthdate`i',0,dateofdiagnosis)==1
}
This does not work for dates before 1960. I think -1<0<1 is logically right but not according to inrange. dis inrange(-1,0,1) gives 0
How can I solve this.
Related Posts with dis inrange(-1,0,1) gives 0 but should give 1
winsorizeDearall Thank you for everything Please, can someone tell me what is the correct command for the pan…
Entropy Balancing in Panel Data SettingHi everyone, I want like to quantify a treatment effect in a model by measuring the differential eff…
question about sem in stataHello I am working on mediation effect using stata SEM. My indepedent variable is binary which answ…
preparing summary statistics tablehello community members, I have panel data for 6 years and have 54 variables in it. I want to prepar…
Bar labels for rbarHi Statalists, I am plotting range bars, where each range bar represents a period spent in bed, sta…
Subscribe to:
Post Comments (Atom)
0 Response to dis inrange(-1,0,1) gives 0 but should give 1
Post a Comment