Hi there,
I'm looking into school standards and want to analyse schools which oversubscribed and undersubscribed. I've made a variable to count this with:
gen capacity_pupils=pupils-capacity //so a school with 500 pupils but a capacity of 400 would get a score of +100 (and vice versa)//
However I'm not at the moment interested with this result as a categorical variable rather than continuous (0 for undersubscribed and 1 for over). So I wanted to recode all my variables in capacity_pupils >0=1 and <0=0 but Stata shouts at me when I try to do that! I've managed to split them apart with:
gen oversub=capacity_pupils if capacity_pupils>0
gen undersub=capacity_pupils if capacity_pupils<0
But now I can't merge them together properly. Has anyone got any ideas of how to do this?
Appreciate any help you can give
Cheers
Max
Array
Related Posts with Recoding variables >0 and <0
Homogeneity and symmetry condition in LA-AIDS in stata command suregDear community, I want to estimate LA-AIDS with homogeneity and symmetry conditions imposed. I have …
Reverse geocoding with geoinpoly gives inaccurate results helpHello, I am trying to use geoinpoly to extract countries from coordinates. I am using the 'PDSI - M…
convert string to date: some observations are missing valuesDear Stata Users I am converting string to date variable running the following code: Code: gen da…
Problem with Stata's parsing of command options in graphical commandsDear All, I suspect a bug in Stata's parsing of command options in graphical commands. Can someone c…
cascading flag variablesHi there Any advice on an easy way to code the following would be greatly appreciated. Code: clea…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding variables >0 and <0
Post a Comment