Hi All,
I am attempting to calculate the difference in means between two variables existing in different geographic regions.
I have two variables avg1 and avg2 that calculate the mean score of a specific variable based on each communities location within the country. There two averages represent different community types (eg. "Rural vs Urban"). I now want to calculate the difference in the averages between rural and urban communities in the same geographic location.
So the variables I am working with are:
identifier = the variable that categorizes the communities (amalgamates a regional and census division code to identify specific locations) STRING
avg1 = average wellbeing score of Urban communities within a specific region, based on identifier. FLOAT var
avg2 = average wellbeing score of Rural Communities, within a specific region, based on identifier.FLOAT
I tried codes like gen difference = avg1 - avg2 but that doesn't work, and it doesn't specific how to select only those avg1 and avg2s that occur in the same geo graphic region.
I apologize in advance if this is unclear, I'm a newbie at Stata.
Many thanks in advance for the help,
Linz
I am attempting to calculate the difference in means between two variables existing in different geographic regions.
I have two variables avg1 and avg2 that calculate the mean score of a specific variable based on each communities location within the country. There two averages represent different community types (eg. "Rural vs Urban"). I now want to calculate the difference in the averages between rural and urban communities in the same geographic location.
So the variables I am working with are:
identifier = the variable that categorizes the communities (amalgamates a regional and census division code to identify specific locations) STRING
avg1 = average wellbeing score of Urban communities within a specific region, based on identifier. FLOAT var
avg2 = average wellbeing score of Rural Communities, within a specific region, based on identifier.FLOAT
I tried codes like gen difference = avg1 - avg2 but that doesn't work, and it doesn't specific how to select only those avg1 and avg2s that occur in the same geo graphic region.
I apologize in advance if this is unclear, I'm a newbie at Stata.
Many thanks in advance for the help,
Linz
Comment