Description Usage Arguments Details Value See Also Examples
Aggregates the data into higher level groups by calculating the sum of all the numeric data columns by group
1 |
data |
a data frame with |
sumby |
a character or numeric vector of length 1 identifying either
the name or columns position of the variables in |
drop |
a character or numeric vector identifying any variables to be dropped from the aggregated data, such as lower-level names and identifiers |
Sometimes a population group is too few in number sensibly to be analysed at the smallest area scale. An indication of this is when the expected value under randomisation of the index of dissimilarity is a large fraction of the observed value. In this case, the data can be aggregated into higher level units, summing the population counts. Aggregating the data also can be used to explore how the index changes with the scale of analysis.
a data frame containing the aggregated data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
data(ethnicities)
head(ethnicities)
id(ethnicities, vars = c("Arab","Other","Persons"), expected = TRUE)
# the expected value is very high relative to the ID
aggdata <- sumup(ethnicities, sumby = "LSOA", drop = "OA")
head(aggdata)
id(aggdata, vars=c("Arab","Other","Persons"), expected = TRUE)
# Note the sensitivity of the ID to the scale of analysis
## End(Not run)
data(aggdata)
head(aggdata)
moreagg <- sumup(ethnicities, sumby = "MSOA", drop = "LSOA")
head(moreagg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.