set.seed(123)
x <- factor(sample(1:4, 250, replace=TRUE))
pr1 <- pram(x)
length(which(pr1$x == x))
x2 <- as.factor(sample(1:4, 250, replace=TRUE))
length(which(pram(x2)$x == x2))
data(free1)
free1 <- data.frame(free1)
free1[,"MARSTAT"] <- as.factor(free1[,"MARSTAT"])
marstatPramed <- pram(free1[,"MARSTAT"])
## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','sex'),
pramVars=c('water','electcon','relat'),
numVars=c('expend','income','savings'), weightVar='sampling_weight')
sdc <- pram(sdc, pramVar="water")
Run the code above in your browser using DataLab