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
export excelHi STATALIST, The following program runs fine when there is at least on observation in each sheet. …
Plotting a histogramHi I am working with village wise consumption data and I need to generate histograms for the consum…
Using NetCDF data in StataHello, I am trying to use data stored in the NetCDF format (.nc file extension) for a project I am …
FormatHello All, I have a difficulty formating my year variable in my data set. The data set is a huge ta…
Testing coefficient equality across different regressions (bootstrap)Dear All, Suppose that I estimate the following two regressions (please ssc install ivreghdfe. In ad…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding variables >0 and <0
Post a Comment