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

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

[复制链接]
发表于 2012-9-29 23:25:05 | 显示全部楼层 |阅读模式
protectLinkedTables(sdcTable)
protectLinkedTables()所属R语言包:sdcTable

                                        protect two <a href="sdcProblem-class.html">sdcProblem-class</a> objects that have common cells
                                         保护<a href="sdcProblem-class.html"> sdcProblem类</ a>的对象有共同的单元的

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

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

protectLinkedTables can be used to protect tables, that have common cells. It is of course required that after the anonymization process has finished, all common cells have the same anonymization state in both tables.
protectLinkedTables可以用来保护表,有共同的单元。它当然要求匿名化过程已完成后,所有常见的单元在两个表中都具有相同的匿名状态。


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


  protectLinkedTables(objectA, objectB, commonCells,
    method, ...)



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

参数:objectA
a sdcProblem-class object
sdcProblem-class对象


参数:objectB
a sdcProblem-class object
sdcProblem-class对象


参数:commonCells
a list object defining common cells in codeobjectA and objectB. For each variable that has one or more common codes in both tables, a list element needs to be specified.   
一个列表对象,确定共同的单元在codeobjectA和objectB。对于每个变量,在两个表中都具有一个或多个共同的代码,一个列表元素需要被指定。

List-elements of length 3: Variable has exact same levels and structure in both tables   
列表元素的长度为3:变量在两个表中有相同的水平和结构

first   element: character vector of length 1 specifying the variable name in argument objectA  
first   element:字符长度为1的向量参数指定的变量名,objectA

second element: character vector of length 1 specifying the variable name in argument objectB  
second element:字符长度为1的向量参数指定的变量名,objectB

third element: character vector of length 1 being with keyword ALL  
third element:与关键字的字符向量的长度为1 ALL




List-elements of length 4: Variable has different codes and levels in tables objectA and objectB   
列表元素的长度为4:变量有不同的代码,表中objectA和objectB

first element: character vector of length 1 specifying the variable name in argument objectA  
first element:字符长度为1的向量参数指定的变量名,objectA

second element: character vector of length 1 specifying the variable name in argument objectB  
second element:字符长度为1的向量参数指定的变量名,objectB

third element: character vector defining codes within objectA  
third element:字符向量定义代码在objectA

fourth element: character vector with length that equals the length of the third list-element. The vector defines codes of the variable in objectB that match the codes given in the third list-element for objectA.  
fourth element:字符向量等于第三个列表元素的长度的长度。的矢量定义的变量的代码,在objectBobjectA中的第三个列表元素给出的代码相匹配。

</ul>
</ ul>


参数:method
a character vector of length 1 specifying the algorithm that should be used to protect the primary sensitive table cells. Allowed values are:   
长度为1的一个字符矢量指定应使用的算法,该算法保护主敏感的表格单元格。允许的值是:

HITAS:  
HITAS:

HYPERCUBE:  
HYPERCUBE:

OPT:  </ul>
OPT:</ ul>


参数:...
additional arguments to control the secondary cell suppression algorithm. For details, see protectTable.
额外的参数来控制的二次电池抑制算法。有关详细信息,请参阅protectTable。


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

a list of length 2 with each list-element being an safeObj-class object
一个长度为2的列表,每个列表元素的safeObj-class对象


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



Bernhard Meindl <a href="mailto:bernhard.meindl@statistik.gv.at">bernhard.meindl@statistik.gv.at</a>




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

protectTable
protectTable


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


## Not run: [#不运行:]
# load micro data for further processing[加载微观数据进行进一步的处理]
sp <- searchpaths()
fn <- paste(sp[grep("sdcTable", sp)], "/data/microData2.RData", sep="")
microData <- get(load(fn))

# table1: defined by variables 'gender' and 'ecoOld'[表1:定义的变量“性别”和“ecoOld”]
microData1 <- microData[,c(2,3,5)]

# table2: defined by variables 'region', 'gender' and 'ecoNew'[表2:定义的变量“区域”,“性别”和“ecoNew”]
microData2 <- microData[,c(1,2,4,5)]

# we need to create information on the hierarchies[我们需要创建信息的层次结构]
# variable 'region': exists only in microDat2[变量“区域”只存在于microDat2]
dim.region <- data.frame(h=c('@','@@','@@'), l=c('Tot', 'R1','R2'))

# variable 'gender': exists in both datasets[变量“性别”:存在于两个数据集]
dim.gender <- data.frame(h=c('@','@@','@@'), l=c('Tot', 'm','f'))

# variable 'ecoOld': exists only in microDat1[变量的ecoOld:只存在于microDat1]
dim.ecoOld <- data.frame(
        h=c('@','@@','@@@','@@@','@@','@@@','@@@'),
        l=c('Tot','A','Aa','Ab','B','Ba','Bb'))

# variable 'ecoNew': exists only in microDat2[变量的ecoNew:只存在于microDat2]
dim.ecoNew <- data.frame(
        h=c('@','@@','@@@','@@@','@@@','@@','@@@','@@@','@@@'),
        l=c('Tot','C','Ca','Cb','Cc','D','Da','Db','Dc'))

# creating objects holding information on dimensions[创建对象信息的尺寸]
dimList1 <- list(gender=dim.gender, ecoOld=dim.ecoOld)
dimList2 <- list(region=dim.region, gender=dim.gender, ecoNew=dim.ecoNew)

# creating input objects for further processing. For details have a look at[创建输入对象,以便进一步处理。对于细节有看]
# \code{\link{makeProblem}}.[\代码{\的链接{makeProblem}}。]
problem1 <- makeProblem(data=microData1, dimList=dimList1, dimVarInd=c(1,2),
                        numVarInd=3, isMicroData=TRUE)
problem2 <- makeProblem(data=microData2, dimList=dimList2, dimVarInd=c(1,2,3),
                        numVarInd=4, isMicroData=TRUE)

# the cell specified by gender=='Tot' and ecoOld=='A'[按性别==“总计”和ecoOld指定的单元格==A]
# is one of the common cells! -&gt; we mark it as primary suppression[是常见的单元之一! - >我们将其标记为主要抑制]
problem1 <- changeCellStatus(problem1, characteristics=c('Tot', 'A'),
                varNames=c('gender','ecoOld'), rule='u', verbose=FALSE)

# the cell specified by region=='Tot' and gender=='f' and ecoNew=='C'[指定的单元格区域==总计和性别==f和ecoNew ==C]
# is one of the common cells! -&gt; we mark it as primary suppression[是常见的单元之一! - >我们将其标记为主要抑制]
problem2 <- changeCellStatus(problem2, characteristics=c('Tot', 'f', 'C'),
        varNames=c('region','gender', 'ecoNew'), rule='u', verbose=FALSE)

# specifying input to define common cells[指定输入确定共同的单元]
commonCells <- list()

# variable "gender"[变量“性别”]
commonCells$v.gender <- list()
commonCells$v.gender[[1]] &lt;- 'gender' # variable name in 'problem1'[变量名“problem1”]
commonCells$v.gender[[2]] &lt;- 'gender' # variable name in 'problem2'[变量名“problem2”]
# 'gender' has equal characteristics on both datasets -&gt; keyword 'ALL'[“性别”具有同等的特性,这两个数据集 - >关键字“ALL”]
commonCells$v.gender[[3]] <- 'ALL'

# variable: ecoOld and ecoNew[变量:ecoOld和ecoNew]
commonCells$v.eco <- list()
commonCells$v.eco[[1]] &lt;- 'ecoOld'        # variable name in 'problem1'[变量名“problem1”]
commonCells$v.eco[[2]] &lt;- 'ecoNew'        # variable name in 'problem2'[变量名“problem2”]

# vector of common characteristics: A and B in variable 'ecoOld' in 'problem1'[向量的共同特点是:A和B在的变量“ecoOld”在“problem1”]
commonCells$v.eco[[3]] <- c("A","B")
# correspond to characteristics 'C' and 'D' in variable 'ecoNew' in 'problem2'[对应的特点在的变量“ecoNew”在“problem2的C,D”]
commonCells$v.eco[[4]] <- c("C","D")

# protect the linked data[保护链接的数据]
result <- protectLinkedTables(problem1, problem2, commonCells, method='HITAS', verbose=TRUE)

# having a look at the results[看看结果]
result.tab1 <- result[[1]]
result.tab2 <- result[[2]]
summary(result.tab1)
summary(result.tab2)

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 02:39 , Processed in 0.032546 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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