calc_sde {aspace} | R Documentation |
This function computes the Standard Deviation Ellipse (SDE) for a set of points. The SDE is a centrographic measure used to characterize the dispersion of point observations along two orthogonal axes. The SDE also captures directional bias in aspatial point pattern and will be oriented in the direction of maximum dispersion. The function provides options for weighting observations, and centring the ellipse on a user defined point, mean centre, or weighted mean centre of the input point locations. Output includes plotting of the SDE and an ASCII (text) file containing elliptical coordinates.
calc_sde(id = 1, filename = "SDE_Output.txt", calccentre = FALSE, useWMC = FALSE, centre.xy = centre, destmat = activities, titletxt = "Title", verbose = FALSE, plot = TRUE, calcSDxy = TRUE, plotSDEaxes = TRUE, plotdest = TRUE, plotcentroid = TRUE, plotSDxy = TRUE, weightpoints = FALSE, weights = wts, jpeg = FALSE)
id |
An identifier for a given SDE. When running calc.sde in a loop for multiple sets of points, increment id such that it is unique! |
filename |
The name of an ASCII (text) file where SDE coordinates will be written |
calccentre |
Boolean: Set to TRUE if the mean center of the points is to be used as the SDE centroid |
useWMC |
Boolean: Set to TRUE if the weighted mean center is to be used as the SDE centroid |
centre.xy |
A numeric vector of length 2, containing specified x- and y-coordinates to use as the centroid |
destmat |
A numeric matrix or data frame with two columns. The first column represents x-coordinates, the second, y-coordinates. Each row corresponds to a single point location. |
titletxt |
A string to use as the title on the plot |
verbose |
Boolean: Set to TRUE if extensive standard output feedback is desired |
plot |
Boolean: Set to TRUE if the SDE is to be plotted |
calcSDxy |
Boolean: Set to TRUE if the standard deviations in the orthogonal (x and y) directions are to be computed |
plotSDEaxes |
Boolean: Set to TRUE if the orthogonal axes through the centroid are to be plotted |
plotdest |
Boolean: Set to TRUE if input point observations are to be plotted along with the SDE |
plotcentroid |
Boolean: Set to TRUE if the centroid is to be plotted along with the SDE |
plotSDxy |
Boolean: Set to TRUE if the orthogonal standard deviation box should be plotted along with the SDE |
weightpoints |
Boolean: Set to TRUE if the point observations are to be weighted |
weights |
A matrix or data frame of weights for the points |
jpeg |
Boolean: Set to TRUE if the plot should be saved in JPEG format |
This function is most powerful when used repetitively within a loop to compute the SDE for subsets of points stored in a large data table.
The returned result is a list:
CALCCENTRE |
Boolean: Indicates whether the mean centre was computed |
WeightPoints |
Boolean: Indicates whether the points were weighted |
UseWMC |
Boolean: Indicates whether the weighted mean centre is to be used |
Orig.x |
Original x-coordinate of centre |
Orig.y |
Original y-coordinate of centre |
CENTRE.x |
x-coordinate after computation of mean centre |
CENTRE.y |
y-coordinate after computation of mean centre |
Sigma.x |
Half-length of axis along x-axis |
Sigma.y |
Half-length of axis along y-axis |
Major |
String indicating which axis is the major elliptical axis |
Minor |
String indicating which axis is the minor elliptical axis |
Theta |
Rotation angle in degrees |
Eccentricity |
A measure of eccentricity |
Area.sde |
Area of the SDE |
TanTheta |
Trigonometric result |
SinTheta |
Trigonometric result |
CosTheta |
Trigonometric result |
SinThetaCosTheta |
Trigonometric result |
Sin2Theta |
Trigonometric result |
Cos2Theta |
Trigonometric result |
ThetaCorr |
Corrected theta angle for rotation of major axis from north |
WMC.x |
Weighted mean center x-coordinate |
WMC.y |
Weighted mean center y-coordinate |
This function can be used on its own (once) or repetitively in a loop to process grouped point data stored in a larger table. When used repetitively, be sure to increment the id parameter to ensure that each SDE has a unique identifier. The output ASCII coordinate file can be further processed using the makeshapes function to generate an ESRI Shapefile for SDE polygons.
Tarmo K. Remmel, Ron Buliung
See chapter 4 of the documentation manual for CrimeStat at http://www.icpsr.umich.edu/CRIMESTAT/ and Ebdon, D. 1987. Statistics in geography. 2nd edition. New York, NY Basil Blackwell Ltd. 232 p.
calc_sdd
, calc_mcp
,
makeshapes
calc_sde(id = 1, filename = "SDE_Output.txt", calccentre = FALSE, useWMC = FALSE, centre.xy = centre, destmat = activities, titletxt = "Title", verbose = FALSE, plot = TRUE, calcSDxy = TRUE, plotSDEaxes = TRUE, plotdest = TRUE, plotcentroid = TRUE, plotSDxy = TRUE, weightpoints = FALSE, weights = wts, jpeg = FALSE)