Hello,
I am struggling to run those two command
bysort house floor: if floor == "F4 - F40" egen newvar = fill (4/40)
bysort house floor: if floor == "F3 - F40" egen newvar2 = fill (3/40)
for each combination of house and floor, I want to create a variable that takes as value the sequence from 3 to 40 or 4 to 40 depending of the value of floor.
However stata tell me that if can not be combined with by and fill
I am struggling to run those two command
bysort house floor: if floor == "F4 - F40" egen newvar = fill (4/40)
bysort house floor: if floor == "F3 - F40" egen newvar2 = fill (3/40)
for each combination of house and floor, I want to create a variable that takes as value the sequence from 3 to 40 or 4 to 40 depending of the value of floor.
However stata tell me that if can not be combined with by and fill
Comment