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

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

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

                                        create <a href="sdcProblem-class.html">sdcProblem-class</a>-objects
                                         创建<a href="sdcProblem-class.html"> sdcProblem类</ a>的对象

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

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

Function makeProblem is used to create sdcProblem-class-objects.
函数makeProblem被用来创建sdcProblem-class对象。


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


  makeProblem(data, dimList, dimVarInd, freqVarInd = NULL,
    numVarInd = NULL, weightInd = NULL,
    sampWeightInd = NULL, isMicroData)



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

参数:data
a data frame featuring at least one column for each desired dimensional variable. Optionally the input data can feature variables that contain information on cell counts, weights that should be used during the cut and branch algorithm, additional numeric variables or variables that hold information on sampling weights.
设有至少一列的每个所需的二维变量的数据框。任选地,所输入的数据可以采用包含对单元计数,切割和分支算法,额外的数字变量或变量有取样权重的信息的过程中,应使用的权重的信息的变量。


参数:dimList
a named list with each list element being either a data-frame or a link to a .csv-file containing the complete level-hierarchy of a dimensional variable using a top-to-bottom approach. The list names correspond to variable names that must exist in argument data. The level-hierarchy must be specified as follows:   
命名列表,每个列表元素是一个数据框或链接到。csv文件,其中包含完整的等级层次结构的三维变量,使用自顶至底的方法。的列表名称对应的变量名必须存在于参数data。水平层次,必须指定如下:

list-element is a data-frame that must contain exactly 2 columns with the first column specifying levels and the second column holding variable-codes.   
列表元素是一个数据框,它必须包含正好2列与第一列的指定水平和第二列保持可变码。

first column: a character vector specifying levels with each vector element being a string only containing of '@'s from length 1 to n. If a vector element consists of i-chars, the corresponding code is of level i. The code '@' (one character) equals the grand total (level=1).  
第一列:与每个向量元素是仅包含从长度为1到n的“@”的字符串的一个字符矢量指定水平。如果一个向量元素由i-chars的,相应的代码是的水平i。代码“@”(一个字符)等于(= 1),共展宏图。

second column: a character vector specifying level codes  
第二列:字符向量指定级别代码




list-element is full path to a .csv-file with two columns seperated by semicolons (;) having the same structure as the data.frame described above  </ul>
列表元素是一个CSV文件的完整路径用分号(;) </ UL上述的数据框具有相同的结构分隔两列>


参数:dimVarInd
numeric vector (or NULL) defining the column-indices of dimensional variables (defining the table) within argument data
数字矢量(或NULL)定义的多维变量(定义表)内的列索引参数data


参数:freqVarInd
numeric vector (or NULL) defining the column-indices of a variable holding counts within argument data
数字矢量(或NULL)定义一个变量保存数列指数内的话,data


参数:numVarInd
numeric vector (or NULL) defining the column-indices of additional numeric variables available in argument data
数字矢量(或NULL),列指数提供额外的数字变量参数data


参数:weightInd
numeric vector of length 1 (or NULL) defining the column-index of a variable holding weights that should be used during as objective coefficients during the cut and branch algorithm to protect primary sensitive cells within argument data
数值向量的长度为1(或NULL)期间为目标系数在切割和分支算法来保护主敏感的单元内参数data期间,应使用一个变量保持权重定义的列索引


参数:sampWeightInd
numeric vector of length 1 (or NULL) defining the column-index of a variable holding sampling weights within argument data
数字矢量的长度为1(或NULL)内定义的变量控股取样权重的列索引参数data


参数:isMicroData
logical vector of length 1 that is 'TRUE' if argument data are micro data and 'FALSE' otherwise
逻辑向量的长度为1,即TRUE,如果参数data是微观数据和“FALSE”,否则


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

a sdcProblem-class-object
sdcProblem-class对象


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



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




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


## Not run: [#不运行:]
# loading micro data[加载微观数据]
sp <- searchpaths()
fn <- paste(sp[grep("sdcTable", sp)], "/data/microData1.RData", sep="")
microData <- get(load(fn))

having a look at the data structure
str(microData)

# specify structure of hierarchical variable 'region'[指定结构的分层变量“区域”]
# levels 'A' to 'D' sum up to a Total[水平A至D金额最多合共]
dim.region <- data.frame(
        levels=c('@','@@','@@','@@','@@'),
        codes=c('Total', 'A','B','C','D'),
        stringsAsFactors=FALSE)

# specify structure of hierarchical variable 'gender'[指定结构的层次变“性别”]
# levels 'male' and 'female' sum up to a Total[总的水平“男性”和“女性”和]
dim.gender <- data.frame(
        levels=c('@','@@','@@'),
        codes=c('Total', 'male','female'),
        stringsAsFactors=FALSE)

# create a list with each element being a data-frame containing information[创建一个列表的每个元素是一个数据框的含信息]
# on a dimensional variables[在多维变量]
dimList <- list(dim.region, dim.gender)

# name the list:[命名列表:]
# - first list-element: corresponds to variable 'region'[ - 第一个列表元素:对应变量“区域”]
# - second list-element: corresponds to variable 'gender'[ - 第二个列表元素:对应变量的性别“]
names(dimList) <- c('region', 'gender')

# specify the indices where dimensional variables are located[三维变量位于指定索引]
# within the input data[所输入的数据内]

# - variable 'region': first column[ - 变量“区域”:第一列]
# - variable 'gender': second column[ - 变量“性别”:第二列]
dimVarInd <- c(1,2)

# no variables holding counts, numeric values, weights or sampling[没有变量数,数值,重量或抽样]
# weights are available in the input data[权重,可在所输入的数据]
freqVarInd <- numVarInd <- weightInd <- sampWeightInd <- NULL

# but we are dealing with micro data![但我们正在处理的微观数据!]
isMicroData <- TRUE

# creating an object of class \code{\link{sdcProblem-class}}[创建一个对象类\代码{\的链接{sdcProblem级}}]
problem <- makeProblem(
        data=microData,
        dimList=dimList,
        dimVarInd=dimVarInd,
        freqVarInd=freqVarInd,
        numVarInd=numVarInd,
        weightInd=weightInd,
        sampWeightInd=sampWeightInd,
        isMicroData=isMicroData)

what do we have?
print(class(problem))

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

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 03:34 , Processed in 0.020391 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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