Learn R Programming

sdcMicro (version 2.6.3)

pram: 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

Value

  • xoriginal vector
  • xpramedthe perturbed vector
  • pdrandomly generated diagonal entry of the P (between original pd and 1)
  • Rsinvariant transition matrix
  • alphaamout 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.

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

Run this code
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"])

Run the code above in your browser using DataLab