Hello,
I have a datafile with 188 neighborhoods, where each neighborhood has 7 yearly values (2015-21) of 8 unique crime types (Category variable). I showed below what the datafile looks like for the first 3 neighborhoods. I'd like to reformat this datafile to swap the Category variable with the YR variables so that the first column measures the year (values equal 2015 through 2021) and each value of Category is its own variable/column. Does anyone know the code or command to do this? Thank you very much.
I have a datafile with 188 neighborhoods, where each neighborhood has 7 yearly values (2015-21) of 8 unique crime types (Category variable). I showed below what the datafile looks like for the first 3 neighborhoods. I'd like to reformat this datafile to swap the Category variable with the YR variables so that the first column measures the year (values equal 2015 through 2021) and each value of Category is its own variable/column. Does anyone know the code or command to do this? Thank you very much.
Comment