pram {sdcMicro}R Documentation

Post RAndomisation Method (PRAM)

Description

PRAM is a probabilistic, perturbative method which can be applied on categorical variables.

Usage

pram(x, pd=0.8, alpha=0.5)

Arguments

x a numeric vector or factor
pd minimum diagonal entries for the generated transition matrix P. Either a vector of length 1 or a vector of length ( number of categories ).
alpha amout of perturbation for the invariant Pram method

Details

The method is implemented exactly as descibed in the citation in the references. First a transition matrix is created in that way, that the diagonal entries of a matrix P are random numbers between ‘pd’ and 1. The remaining enties of the matrix are generated such that the rowSums of the matrix is 1. Then a invariant transition matrix is generated.

Value

x original vector
xpramed the perturbed vector
pd randomly generated diagonal entry of the P (between original pd and 1)
Rs invariant transition matrix
alpha amout of perturbation for the invariant Pram method

Author(s)

Matthias Templ

References

Shlomo, Natalie and de Waal, Ton (2006) Protection of Micro-data Subject to Edit Constraints Against Statistical Disclosure. Southampton, UK, Southampton Statistical Sciences Research Institute, 36pp. (S3RI Methodology Working Papers, M06/16)

Examples

set.seed(123)
x <- sample(1:4, 250, replace=TRUE)
pr1 <- pram(x)
length(which(pr1$x == x))
x2 <- sample(1:4, 250, replace=TRUE)
length(which(pram(x2)$x == x2))

data(free1)
marstatPramed <- pram(free1[,"MARSTAT"])  

[Package sdcMicro version 2.5.8 Index]