Skip to content

Commit 23046e3

Browse files
committed
Version 0.2.0 (Prototype Version for Testing)
1 parent d3ee0f2 commit 23046e3

3 files changed

Lines changed: 19 additions & 16 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: ptable
22
Type: Package
33
Date: 2018-12-02
44
Title: Generation of perturbation tables
5-
Version: 0.1.14
5+
Version: 0.2.0
66
Authors@R: c(person("Tobias", "Enderle", email = "tobias.enderle@destatis.de", role = c("aut", "cre")),
77
person("Sarah", "Giessing", email = "sarah.giessing@destatis.de", role = c("ctb")))
88
Description: This package computes perturbation tables with probabilities or pre-drawn perturbation values.
@@ -14,4 +14,4 @@ Encoding: UTF-8
1414
Maintainer: Tobias Enderle <tobias.enderle@destatis.de>
1515
LazyData: true
1616
RoxygenNote: 6.0.1
17-
VignetteBuilder: knitr
17+
VignetteBuilder: knitr

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ We have a first rough version with which interested users may play around. Feedb
2626
- Add generic functions in pt\_methods.R, e.g. plot(...)
2727
- Update optimization for predrawn allocation if `type="abs"`
2828

29-
### Version 0.1.14
29+
#### Version 0.2.0
30+
31+
- Prototype Version for Testing (Census)
32+
33+
#### Version 0.1.14
3034

3135
- feature: new argument `SDCtool` of function `pt_export()`: either "TauArgus" or "SAS"
3236
- feature: vignette and new function `pt_vignette()` to show it
@@ -77,7 +81,6 @@ We have a first rough version with which interested users may play around. Feedb
7781

7882
- first uploaded version
7983

80-
8184
### Installation
8285

8386
The package can directly be installed from `github`

vignettes/introduction.Rmd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ packageVersion("ptable")
7878
```
7979

8080

81-
### E1. Minimal Parameter Setting and Computation of the Transition Probabilities
81+
### Minimal Parameter Setting and Computation of the Transition Probabilities
8282

83-
#### E1.1 Minimal Parameter Setting
83+
#### Minimal Parameter Setting
8484
```{r}
8585
# note: all parameters except for maximum noise D and variance V have default values
8686
params <- pt_create_pParams(D=2, V=1)
@@ -94,7 +94,7 @@ The minimum set of parameters that have to be specified are:
9494

9595
The result of the above function is an object of class "ptable_params", that contains all information necessary for the computation of the perturbation probabilities.
9696

97-
#### E1.2 Computation of the Transition Probabilities
97+
#### Computation of the Transition Probabilities
9898

9999
Once the parameters are set, the probabilities can be computed running:
100100
```{r}
@@ -115,7 +115,7 @@ The most relevant and important slots of the object are:
115115
- `pParams`: The input parameters that result from the preceding function `pt_create_pParams()`.
116116
- `empResults`: A data frame for output checking of the constraints.
117117

118-
#### E1.2.1. The Transition Matrix
118+
#### The Transition Matrix
119119
Let's have a look at the transition matrix (i.e. at the slot `@pMatrix`) of the object `ptable_destatis`:
120120

121121
```{r}
@@ -129,7 +129,7 @@ diag(ptable_destatis@pMatrix)
129129
```
130130
The main diagonal shows the preservation probabilities. These are the probabilities that the original frequencies remain unchanged. In this instance, the probability that an original frequency 2 remains unchanged is `r diag(ptable_destatis@pMatrix)[2+1]`.
131131

132-
#### E1.2.2. Symmetry - and what does it mean in the context of perturbation tables?
132+
#### Symmetry - and what does it mean in the context of perturbation tables?
133133

134134
As you may have recognized, the transition matrix has a finite number of rows (that represent original frequency counts) and columns (that represent the target frequency counts).
135135

@@ -166,9 +166,9 @@ names(b) <- as.character(12326+c(-2:2))
166166
b
167167
```
168168

169-
Given this symmetry, the transition matrix can be displayed in the reduced form. There is no need to define more rows than up to the case of symmetry. The number of columns is then defined by: *number of rows + maximum noise D + `js`*.
169+
Given this symmetry, the transition matrix can be displayed in the reduced form. There is no need to define more rows than up to the case of symmetry.
170170

171-
#### E1.2.3. Output Checking and Troubleshooting
171+
#### Output Checking and Troubleshooting
172172
Next, we will check the empirical results that can be used for troubleshooting:
173173

174174
```{r}
@@ -203,7 +203,7 @@ ptable_destatis_new@pMatrix
203203
The goal of the following subsections is to create perturbation tables with extended and afterwards with advanced parameter settings of the function `pt_create_pParams()`.
204204

205205

206-
### E2. Extended Parameter Setting
206+
### Extended Parameter Setting
207207

208208
The remaining parameters (among others `js` and `pstay`), are set to default if not specified:
209209

@@ -213,7 +213,7 @@ The remaining parameters (among others `js` and `pstay`), are set to default if
213213

214214
However, let's change and modify them with respect to our needs:
215215

216-
#### E2.1 Setting the probability of an original frequency to remain unperturbed
216+
#### Setting the probability of an original frequency to remain unperturbed
217217

218218
```{r}
219219
# note: once again, check the diagonal entries
@@ -228,7 +228,7 @@ The probability of an original frequency to remain unperturbed (i.e. that the ta
228228

229229
**Important note regarding "*false positives*":** Zeroes will not be perturbed to positive frequency counts since unbiasedness is a main characteristic of the cell-key based method.^[If *false positives* are an important part of a protection concept, we recommend to use (targeted record swapping)[https://github.com/sdcTools/protoTestCensus/tree/master/TargetedRecordSwapping] as protection method (alone, or in combination with CKM, as proposed by the SGA "Harmonised protection of census data in the ESS".]
230230

231-
#### E2.2 Do not allow for positive cell values equal to or below a specified threshold value
231+
#### Do not allow for positive cell values equal to or below a specified threshold value
232232

233233
```{r}
234234
# note: ptable::pt_create_pTable(...) could also be used as input for argument "pTable"
@@ -244,7 +244,7 @@ Since the threshold value `js` is set to 2, we do not allow target frequencies 1
244244
Further parameters of the function `pt_create_pParams()` are explained in the help page that can be accessed by calling `?pt_create_pParams()`.
245245

246246

247-
### E3. Advanced Parameter Setting
247+
### Advanced Parameter Setting
248248

249249
Several parameters of the function `pt_create_pParams()` that we have learned so far, can also be assigned to each original positive frequency count separately using the vector notation in R.
250250

@@ -358,7 +358,7 @@ fifi_plot(result, type="d")
358358
```
359359

360360

361-
Alternatively, we would can change the monotony condition for i=1:
361+
Alternatively, we can change the monotony condition for i=1:
362362
```{r, fig.height=5, fig.width = 7}
363363
params <- pt_create_pParams(D=4, V=1.5, pstay=c(0.8,0.9,0.9,0.9), mono=c(FALSE, TRUE, TRUE, TRUE))
364364
result <- pt_create_pTable(params=params, type="destatis")

0 commit comments

Comments
 (0)