Hi all,
My dataset is made up of gasoline stations located by latitude and longitude. These stations are divided into different brands.
I was able to count how many stations there are between zero and one kilometre for each station using:
Now I should count how many stations there are belonging to a particular brand between zero and one kilometre for every single station.
For example: take the first station, Q8. How many Shell stations are there close to Q8 between zero and one kilometre?
take the second station, Tamoil. How many Shell stations are there close to Tamoil between zero and one kilometre?
and so on for every station in my dataset.
I tried to insert the "if" operator but I get the same result as before.
Does anyone know how to do it?
Thanks in advance.
Mario
My dataset is made up of gasoline stations located by latitude and longitude. These stations are divided into different brands.
I was able to count how many stations there are between zero and one kilometre for each station using:
Code:
nearstat latitudine longitudine, near(latitudine longitudine) distvar(distnn1) ncount(nn_01) dband(0 1) replace
For example: take the first station, Q8. How many Shell stations are there close to Q8 between zero and one kilometre?
take the second station, Tamoil. How many Shell stations are there close to Tamoil between zero and one kilometre?
and so on for every station in my dataset.
I tried to insert the "if" operator but I get the same result as before.
Code:
nearstat latitudine longitudine if Shell==1, near(latitudine longitudine) distvar(distnn1) ncount(nn_01) dband(0 1) replace
Thanks in advance.
Mario
Comment