find_best_selection {sms}R Documentation

find_best_selection

Description

Find the best selection of individual records for a census area.

Usage

find_best_selection(area, insms, inseed = -1)

Arguments

area

A census area

insms

A microsimulation object which holds the data and details of the simulation such as iterations, lexicon.

inseed

test

Details

Calculate the best area representation, after a series of selection tries.

Value

list A list with results (#areaid, #selection, #tae, #tries, #error_states).

Author(s)

Dimitris Kavroudakis dimitris123@gmail.com

Examples

library(sms)
data(survey) #load the data
data(census)
in.lexicon=createLexicon() # Create a data lexicon for holding the associated column names.
in.lexicon=addDataAssociation(in.lexicon, c("he","he"))
in.lexicon=addDataAssociation(in.lexicon, c("females","female"))

this_area=as.data.frame(census[1,]) #Select the first area from the census table
insms= new("microsimulation",census=census,panel=survey, lexicon=in.lexicon, iterations=10)
best=find_best_selection(this_area, insms)
print(best)

[Package sms version 2.3.1 Index]