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

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

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

                                        Calculate Index of Dissimilarity
                                         计算指数相异

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

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

seg calculates Duncan and Duncan's index of dissimilarity between two population groups. If "nb" is given, the index can be adjusted to reflect the spatial distribution of population.
seg计算邓肯和邓肯的两个人口群体之间的差异性指数。如果NB,索引可以进行调整,以反映人口的空间分布。


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


seg(data, nb, verbose = FALSE)



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

参数:data
a numeric matrix or data frame with two columns that represent mutually exclusive population groups (e.g., Asians and non-Asians). If more than two columns are given, only the first two will be used for computing the index.
两列表示相互排斥的群体(例如,亚洲人和非亚洲人)的数字矩阵或数据框。如果两个以上的列中给出的,只有前两个将被用于计算索引。


参数:nb
an optional matrix object describing the intensity of interaction between geographic units.
一个可选的matrix对象,它描述的GEO单元之间的相互作用强度。


参数: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, seg calculates the traditional index of dissimilarity proposed by Duncan and Duncan (1955).
nb的必须是一个方阵(相同的行数和列数),但不必须是对称的。当NB未指定,seg计算的传统相异指数由邓肯,邓肯(1955)提出。

If "nb" is a rook-based contiguity matrix standardised by the total number of neighbours, the calculation follows the Morrill's adjusted index of dissimilarity (1991). See the example code below and help(nb2mat) for more information regarding how to construct such a matrix.
如果NB是一车基于标准化的邻接矩阵的邻居的总数,计算如下莫里尔的调整相异指数(1991年)。请参见下面的示例代码和help(nb2mat)的更多信息,就如何构建这样一个矩阵。

If "nb" contains row-standardised shared boundary lengths between geographic units, the computed index is Wong's adjusted D. In R, vect2neigh in the spgrass6 package can be used to obtain the shared boundary lengths.
如果NB包含的行标准化共享的GEO单元之间的边界长度,计算出的指数是黄的调整D.在R,vect2neigh中spgrass6包,可以用来获得共享的边界长度。


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

A single numeric value between 0 and 1, indicating the degree of segregation; 0 for no segregation, and 1 for complete segregation.
介于0和1之间的一个数值,表示程度的隔离; 0,无偏析,并完全隔离。


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



Seong-Yun Hong




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





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

spseg, whiteseg
spseg,whiteseg


实例----------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)
  dd <- numeric(); dm <- numeric()
  par(mfrow = c(2, 4), mar = c(0, 1, 0, 1))
  for (i in 1:8) {
    idx <- 2 * i
    dd <- append(dd, seg(segdata.df[,(idx-1):idx]))
    dm <- append(dm, seg(segdata.df[,(idx-1):idx], segdata.nb))
    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(dd[i], 2),
                                 ", D(adj) = ", round(dm[i], 2), sep = ""))
  }
  
  data(nzcity)
  dd2 <- numeric(); dm2 <- 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)
    dd2 <- append(dd2, seg(city.df))
    dm2 <- append(dm2, seg(city.df, city.nb))
  }
  nzcity.lm <- lm(dm2 ~ dd2)
  summary(nzcity.lm)
  plot(dd2, dm2, xlab = "D", ylab = "D(adj)",
       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(dd2, dm2, pos = which.pos, labels = names(nzcity), cex = 0.8)
}

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 14:49 , Processed in 0.030953 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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