Round2: Small count rounding by various methods

Description Usage Arguments Value See Also Examples

View source: R/Round2.R

Description

Run makeroundtabs() or RoundViaDummy2()

Usage

1
2
Round2(data, control, ..., method = c("roundtabs", "viadummy",
  "viadummyAll"))

Arguments

data

Input data.frame. Same as input parameter A to makeroundtabs()

control

As input to makeroundtabs()

...

Other paramameters as input to makeroundtabs()

method

One of "roundtabs" (default), "viadummy", "viadummyAll" (allTerms=TRUE)

Value

Output from makeroundtabs or RoundViaDummy2

See Also

RoundKostra (SSB internal), RoundViaDummy, Lists2formula, MakeControl, FindMaxDiff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
z <- SmallCountData("sosialFiktiv")
d <- list(c("region","mnd") , c("hovedint","mnd2") , c("fylke","hovedint","mnd2") , 
          c("kostragr","hovedint","mnd"))
con <- MakeControl(d,z)
sor <- names(z)[c(4,5,3,2,1)]

roundedA <-  Round2(data=z,b=3,d=d,micro=FALSE,sort=sor,control=con, nin="ant",nout="Rndtall",
                    minit=2,maxit=10,maxdiff=5,seed=123,method="roundtabs")
roundedB <-  Round2(data=z,b=3,d=d,micro=FALSE,sort=sor,control=con, nin="ant",nout="Rndtall",
                    minit=2,maxit=10,maxdiff=5,seed=123,method="viadummy")
#10 rows of rounded data
roundedA$Ar[1:10,]  #"roundtabs"
cbind(z,roundedB$yInner)[1:10,] #"viadummy"

# recalculate maxdiff  nMaxdiff
dA <- FindMaxDiff(roundedA$Ar,con,"ant","m")
dB <- FindMaxDiff(z,con,roundedB$yInner[,1],roundedB$yInner[,2])

# Formula from d and control
Lists2formula(d,con,z)

# Formula from another d
d2 <-list(sor)
Lists2formula(d2,con,z)
Lists2formula(d2,con) # Without knowing data
Lists2formula(d2,data=z) # Without control
Lists2formula(d2,data=z) # Without control and data

## End(Not run)

SmallCountRounding documentation built on May 2, 2019, 8:33 a.m.