找回密码
 注册
查看: 384|回复: 0

R语言 seg包 whiteseg()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 00:25:20 | 显示全部楼层 |阅读模式
whiteseg(seg)
whiteseg()所属R语言包:seg

                                        Calculate White's Segregation Measure
                                         白色的计算分流的措施

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

whiteseg computes White's segregation statistic. Unlike the traditional index of dissimilarity, this is a spatial measure that takes the spatial arrangements of population into account.
whiteseg白色的计算,隔离统计。不同于传统的相异度指数,这是一个空间的措施,需要考虑到人口的空间安排。


用法----------Usage----------


whiteseg(x, data, nb, method = "euclidean", p = 2, fun, verbose = FALSE)



参数----------Arguments----------

参数:x
a numeric matrix or data frame with coordinates (each row is a point), or an object of class Spatial.
一个数字矩阵或数据框坐标(每行是一个点),或对象的类Spatial。


参数:data
an object of class matrix, or one that can be coerced to that class. The number of rows in "data" should equal the number of geographic units in "x", and the number of columns should be greater than one (at least two population groups are required). This can be missing if "x" has a data frame attached to it.
类matrix,或可以强制转换为该类的对象。 数据的行数应等于GEO单元中的“x”的数,和列的数目应该大于一(至少两个群体是必需的)。这可能会丢失,如果x具有连接到它的数据框。


参数:nb
an optional matrix object indicating the distances between the geographic units.
一个可选的matrix对象表示的GEO单元之间的距离。


参数:method
a length-one character string indicating the distance measure to be used. This argument is passed to dist to calculate the distances between the geographic units in "x". See help(dist) for available options.
长度为一个字符的字符串,用于指示要使用的距离度量。此参数是传递给dist计算中的“x”的GEO单元之间的距离。见help(dist)可用的选项。


参数:p
an optional argument to be passed to dist.
一个可选的参数被传递给dist。


参数:fun
a function for the calculation of proximity. The function should take a numeric vector as an argument (distance) and return a vector of the same length (proximity). If this is not specified, a negative exponential function is used by default.
用于计算的接近的功能。该函数应采取一个数值向量作为参数(距离),并返回一个的矢量具有相同的长度(接近)。如果这是没有指定,默认情况下使用负指数函数。


参数:verbose
logical. If TRUE, print the current stage of the computation and time spent on each job to the screen.
逻辑。如果是TRUE,打印的当前阶段的计算和每个作业上花费的时间,在屏幕上。


Details

详细信息----------Details----------

"nb" must be a square matrix (same number of rows and columns) but does not have to be symmetric. When "nb" is not specified, whiteseg computes the distance matrix of "x" using the specified optional arguments "method" and "p".
nb的必须是一个方阵(相同的行数和列数),但不必须是对称的。当NB未指定,whiteseg计算距离矩阵使用指定的可选参数方法和p的x。


值----------Value----------

A single numeric value indicating the degree of segregation; a value of 1 indicates absence of segregation, and values greater than 1.0 indicate clustering. If the index value is less than one, it indicates an unusual form of segregation (i.e., people live closer to other population groups).
一个数值表示的隔离程度;值1表示没有隔离和值大于1.0,表明聚类。如果索引值小于1时,表示一个不寻常的形式隔离(即,人们的生活更接近其他人口群体)。


(作者)----------Author(s)----------



Seong-Yun Hong




参考文献----------References----------



参见----------See Also----------

seg, spseg, dist
seg,spseg,dist


实例----------Examples----------


if (require(spdep)) {
  data(segdata)
  segdata.df <- data.frame(segdata)
  segdata.nb <- nb2mat(poly2nb(segdata, queen = FALSE), style = "B")
  segdata.nb <- segdata.nb / sum(segdata.nb)
  d <- numeric(); p <- numeric()
  par(mfrow = c(2, 4), mar = c(0, 1, 0, 1))
  for (i in 1:8) {
    idx <- 2 * i
    d <- append(d, seg(segdata.df[,(idx-1):idx], segdata.nb))
    p <- append(p, whiteseg(segdata, data = segdata.df[,(idx-1):idx]))
    full <- segdata.df[,(idx-1)] == 100
    half <- segdata.df[,(idx-1)] == 50
    plot(segdata)
    plot(segdata[full,], col = "Black", add = TRUE)
    if (any(half))
      plot(segdata[half,], col = "Grey", add = TRUE)
    text(5, 11.5, labels =
      paste("D = ", round(d[i], 2), ", P = ", round(p[i], 2), sep = ""))
  }
  
  data(nzcity)
  dd <- numeric(); pp <- numeric()
  for (i in 1:16) {
    city.df <- data.frame(nzcity[[i]])
    city.df <- cbind(city.df[,4], apply(city.df[,c(2:3, 5:7)], 1, sum))
    city.nb <- nb2mat(poly2nb(nzcity[[i]], queen = FALSE), style = "B",
                      zero.policy = TRUE)
    city.nb <- city.nb / sum(city.nb)
    dd <- append(dd, seg(city.df, city.nb))
    pp <- append(pp, whiteseg(nzcity[[i]], city.df, fun = function(z) 1/z))
  }
  nzcity.lm <- lm(pp ~ dd)
  summary(nzcity.lm)
  plot(dd, pp, xlab = "D(adj)", ylab = "P",
       main = paste("Residential Segregation of\n",
                    "Pacific Peoples in 16 New Zealand Cities", sep = ""))
  abline(a = nzcity.lm$coefficients[1],
         b = nzcity.lm$coefficients[2], col = "Red", lty = "dotted")
  which.pos <- c(3, 2, 2, 3, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 3, 1)
  text(dd, pp, pos = which.pos, labels = names(nzcity), cex = 0.8)
}

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-18 01:17 , Processed in 0.024398 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表