Learn R Programming

sdcMicro (version 3.1.1)

pram_strata: Post Randomization

Description

To be used on categorical data. It randomly change the values of variables on selected records (normally the risky ones) according to an invariant probability transition matrix.

Usage

pram_strata(data, variables = NULL, strata_variables = NULL, weights = NULL, seed = NULL, missing = -999)
## S3 method for class 'pram_strata':
print(x, ...)

Arguments

data
Input data
variables
Names of variables for Post Randomization
strata_variables
Names of variables for stratification
weights
a weight for each variable
seed
Integer value for the random seed
missing
A integer value to be used as missing value in the C++ routine
x
Output of pram_strata
...
currently unused

Value

  • For each randomized variable a new variable with the suffix "_pram" will be created.

References

http://www.gnu.org/software/glpk http://www.ccsr.ac.uk/sars/guide/2001/pram.pdf

See Also

pram

Examples

Run this code
data(testdata)
  res <- pram_strata(testdata,variables="roof",strata_variables=c("urbrur","sex"))
  print(res)
  res1 <- pram_strata(testdata,variables=c("roof","walls","water"),strata_variables=c("urbrur","sex"))
  print(res1)

Run the code above in your browser using DataLab