I'd like to see what's the share of employed people in the labor force ( employed + unemployed ) in a county for every year available in my sample ( 2000-2021)
So, my target coding is share = (total employed people in a county for a specific year) ) / ( total employed in a county for a specific year+ total unemployed in a county for a specific year )
I want to find this ratio for every county for each year available in my sample (2000-2021)
How can I code this up in Stata ? I have given sample data for convenience.
If employed takes the value 0 , it doesn't mean unemployment will take the value 1. It could be that person is out of labor force. So, both of the variable could show up value 0 in some cases.
So, my target coding is share = (total employed people in a county for a specific year) ) / ( total employed in a county for a specific year+ total unemployed in a county for a specific year )
I want to find this ratio for every county for each year available in my sample (2000-2021)
How can I code this up in Stata ? I have given sample data for convenience.
If employed takes the value 0 , it doesn't mean unemployment will take the value 1. It could be that person is out of labor force. So, both of the variable could show up value 0 in some cases.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year double county float(employed unemployed) 2018 1003 1 0 2012 1003 0 1 2012 1003 1 0 2012 1005 1 0 2019 1005 1 0 2015 1005 0 1 2015 1005 0 0 2005 1007 0 0 2018 1007 1 0 2020 1007 1 0 2007 1007 1 0 2015 1007 0 1 2012 1009 1 0 2009 1009 1 0 2012 1009 0 1 end

Comment