find_best_selection: find_best_selection

Description Usage Arguments Details Value Author(s) Examples

View source: R/sms.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

sms documentation built on May 1, 2019, 8:18 p.m.