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
Understanding Monte Carlo simulations in "When Should You Adjust Standard Errors for Clustering?" (Abadie at al, 2017)Hi statalist members, This is my first post here so pardon me if I deviate from the established eti…
Fe glsHello, My data is suitable for FE model but with heteroscedasticity and autocorrelation, I want to c…
Choose Referans CatogryHello, I m working on a panel with GMM. I want to choose the reference category by myself. However, …
Too many values error when trying using tabulate commandHi I am trying to create a table showing the distribution of age of first marriage across many diffe…
AverageHow should I proceed in the following situation: - I have the earnings of population in 2004 and 200…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding variables >0 and <0
Post a Comment