data(testdata2)
x <- testdata2[,c("sex","water","roof")]
res <- LLmodGlobalRisk(x, form=~sex+water+roof,
inclProb=1/testdata2[,"sampling_weight"])
res$gr1; res$gr2
## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','electcon','relat','sex'),
numVars=c('expend','income','savings'), w='sampling_weight')
sdc <- LLmodGlobalRisk(sdc,form=~sex+water+roof)
Run the code above in your browser using DataLab